Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b160a0f
1、修复一系列issue
CloudlessMoon Sep 11, 2025
fba7a8b
UIBarItem (QMUIBadge),适配LiquidGlass
CloudlessMoon Sep 12, 2025
81b2940
移除不需要的NSAssert
CloudlessMoon Sep 12, 2025
88ef04e
QMUIPopupContainerView,增加一个Assert
CloudlessMoon Sep 15, 2025
807b967
1、QMUIKeyboardManager 适配iOS 26
CloudlessMoon Sep 17, 2025
20229c8
https://github.com/Tencent/QMUI_iOS/issues/1634,修复业务设置UIWindow overri…
CloudlessMoon Sep 24, 2025
4309c34
https://github.com/Tencent/QMUI_iOS/issues/1668,修复qmuisl_stepControls…
CloudlessMoon Sep 24, 2025
df55545
https://github.com/Tencent/QMUI_iOS/issues/1668,修复qmuisl_stepControls…
CloudlessMoon Sep 24, 2025
30ec951
iOS 26,修复转场动画的_QMUITransitionNavigationBar y值错误的问题
CloudlessMoon Sep 25, 2025
440dcd0
iOS 26,_QMUITransitionNavigationBar 设置frame 后,立即触发layoutIfNeeded,否则在手…
CloudlessMoon Sep 25, 2025
7cff349
QMUITheme, [UITraitCollection currentTraitCollection] 改为 UIScreen.mai…
CloudlessMoon Sep 25, 2025
8e2be1a
QMUIModalPresentationViewController、QMUIPopupContainerView增加- (void)s…
CloudlessMoon Sep 26, 2025
1cacb34
UIWindow隐藏时,将windowScene置空
CloudlessMoon Sep 26, 2025
5722070
QMUIModalPresentationViewController适配键盘已经弹起的情况,随后又落下的情况
CloudlessMoon Sep 26, 2025
1bc6018
QMUIPopupContainerView,当上下或者左右没有足够的空间时,不能直接改变maximumHeight或者maximumWi…
CloudlessMoon Sep 26, 2025
a977cbb
QMUITheme, 使用UIScreen的_setDefaultTraitCollection更准确
CloudlessMoon Oct 16, 2025
c8691cc
qmui_addUserInterfaceStyleWillChangeObserver,mac上使用UIScreen的_setDefau…
CloudlessMoon Oct 17, 2025
ebb9d3a
https://github.com/Tencent/QMUI_iOS/issues/1680
CloudlessMoon Oct 23, 2025
12eb8d3
Revert "https://github.com/Tencent/QMUI_iOS/issues/1680"
CloudlessMoon Oct 24, 2025
3ef2a3d
暂时性修复https://github.com/Tencent/QMUI_iOS/issues/1680,此为UIKit的bug
CloudlessMoon Oct 24, 2025
a84b36c
优化获取hx_keyWindow的逻辑,当connectedScenes里找不到keyWindow时,使用UIApplication.sh…
CloudlessMoon Oct 31, 2025
d1c7bfd
iOS 26液态玻璃下,转场动画可以被打断,不需要QMUILogWarn了
CloudlessMoon Nov 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
#import "UINavigationBar+QMUI.h"
#import "UINavigationBar+QMUIBarProtocol.h"
#import "QMUIWeakObjectContainer.h"
#import "QMUIBarProtocolPrivate.h"
#import "UIImage+QMUI.h"
#import "CALayer+QMUI.h"

@implementation UINavigationBar (Transition)

Expand Down Expand Up @@ -51,7 +53,7 @@ + (void)load {
originSelectorIMP(selfObject, originCMD, appearance);

if (selfObject.qmuinb_copyStylesToBar) {
selfObject.qmuinb_copyStylesToBar.standardAppearance = appearance;
selfObject.qmuinb_copyStylesToBar.scrollEdgeAppearance = appearance;
}
};
});
Expand Down Expand Up @@ -222,6 +224,21 @@ + (void)load {
});
}

OverrideImplementation(NSClassFromString(@"_UIBarBackground"), @selector(didMoveToWindow), ^id(__unsafe_unretained Class originClass, SEL originCMD, IMP (^originalIMPProvider)(void)) {
return ^(UIView *selfObject) {

// call super
void (*originSelectorIMP)(id, SEL);
originSelectorIMP = (void (*)(id, SEL))originalIMPProvider();
originSelectorIMP(selfObject, originCMD);

_QMUITransitionNavigationBar *navigationBar = (_QMUITransitionNavigationBar *)selfObject.superview;
if (selfObject.window != nil && [navigationBar isKindOfClass:_QMUITransitionNavigationBar.class]) {
[navigationBar updateLayout];
}
};
});

#ifdef IOS15_SDK_ALLOWED
if (@available(iOS 15.0, *)) {
// - [UINavigationBar _didMoveFromWindow:toWindow:]
Expand Down Expand Up @@ -255,9 +272,12 @@ - (void)setOriginalNavigationBar:(UINavigationBar *)originBar {
}

- (void)layoutSubviews {
[super layoutSubviews];
// 实测 iOS 11 Beta 1-5 里,自己 init 的 navigationBar.backgroundView.height 默认一直是 44,所以才加上这个兼容
self.qmui_backgroundView.frame = self.bounds;
[CALayer qmui_performWithoutAnimation:^{
[super layoutSubviews];
// 实测 iOS 11 Beta 1-5 里,自己 init 的 navigationBar.backgroundView.height 默认一直是 44,所以才加上这个兼容
self.qmui_backgroundView.frame = self.bounds;
[self.qmui_backgroundView layoutIfNeeded];
}];
}

// NavBarRemoveBackgroundEffectAutomatically 在开启了 AutomaticCustomNavigationBarTransitionStyle 时可能对假 bar 无效
Expand All @@ -274,7 +294,12 @@ - (void)updateLayout {
[self.parentViewController.view bringSubviewToFront:self];
UIView *backgroundView = self.originalNavigationBar.qmui_backgroundView;
CGRect rect = [backgroundView.superview convertRect:backgroundView.frame toView:self.parentViewController.view];
self.frame = CGRectSetX(rect, 0);// push/pop 过程中系统的导航栏转换过来的 x 可能是 112、-112
[CALayer qmui_performWithoutAnimation:^{
// push/pop 过程中系统的导航栏转换过来的 x 可能是 112、-112
// iOS 26上,y 可能是 -113
self.frame = CGRectSetXY(rect, 0, 0);
[self layoutIfNeeded];
}];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ - (void)addTransitionNavigationBarAndBindNavigationBar:(BOOL)shouldBind {
}

_QMUITransitionNavigationBar *customBar = [[_QMUITransitionNavigationBar alloc] init];
/// iOS 26不设置items时子视图不会添加
customBar.items = @[[[UINavigationItem alloc] initWithTitle:@""]];
customBar.parentViewController = self;
self.transitionNavigationBar = customBar;

Expand Down
3 changes: 3 additions & 0 deletions QMUIKit/QMUIComponents/QMUIAlertController.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ typedef NS_ENUM(NSInteger, QMUIAlertControllerStyle) {
/// 显示`QMUIAlertController`
- (void)showWithAnimated:(BOOL)animated;

/// 显示`QMUIAlertController`
- (void)showInWindow:(nullable UIWindow *)window animated:(BOOL)animated;

/// 隐藏`QMUIAlertController`
- (void)hideWithAnimated:(BOOL)animated;

Expand Down
6 changes: 5 additions & 1 deletion QMUIKit/QMUIComponents/QMUIAlertController.m
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,10 @@ - (void)customModalPresentationControllerAnimation {
}

- (void)showWithAnimated:(BOOL)animated {
[self showInWindow:nil animated:animated];
}

- (void)showInWindow:(nullable UIWindow *)window animated:(BOOL)animated {
if (self.willShow || self.showing) {
return;
}
Expand Down Expand Up @@ -918,7 +922,7 @@ - (void)showWithAnimated:(BOOL)animated {

__weak __typeof(self)weakSelf = self;

[self.modalPresentationViewController showWithAnimated:animated completion:^(BOOL finished) {
[self.modalPresentationViewController showInWindow:window animated:animated completion:^(BOOL finished) {
weakSelf.dimmingView.alpha = 1;
weakSelf.willShow = NO;
weakSelf.showing = YES;
Expand Down
70 changes: 70 additions & 0 deletions QMUIKit/QMUIComponents/QMUIBadge/UIBarItem+QMUIBadge.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ - (void)setQmui_badgeString:(NSString *)qmui_badgeString {
[self updateViewDidSetBlockIfNeeded];
}
self.qmui_view.qmui_badgeString = qmui_badgeString;
self.qmui_selectedView.qmui_badgeString = qmui_badgeString;
}

- (NSString *)qmui_badgeString {
Expand All @@ -97,6 +98,7 @@ - (NSString *)qmui_badgeString {
- (void)setQmui_badgeBackgroundColor:(UIColor *)qmui_badgeBackgroundColor {
objc_setAssociatedObject(self, &kAssociatedObjectKey_badgeBackgroundColor, qmui_badgeBackgroundColor, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_badgeBackgroundColor = qmui_badgeBackgroundColor;
self.qmui_selectedView.qmui_badgeBackgroundColor = qmui_badgeBackgroundColor;
}

- (UIColor *)qmui_badgeBackgroundColor {
Expand All @@ -107,6 +109,7 @@ - (UIColor *)qmui_badgeBackgroundColor {
- (void)setQmui_badgeTextColor:(UIColor *)qmui_badgeTextColor {
objc_setAssociatedObject(self, &kAssociatedObjectKey_badgeTextColor, qmui_badgeTextColor, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_badgeTextColor = qmui_badgeTextColor;
self.qmui_selectedView.qmui_badgeTextColor = qmui_badgeTextColor;
}

- (UIColor *)qmui_badgeTextColor {
Expand All @@ -117,6 +120,7 @@ - (UIColor *)qmui_badgeTextColor {
- (void)setQmui_badgeFont:(UIFont *)qmui_badgeFont {
objc_setAssociatedObject(self, &kAssociatedObjectKey_badgeFont, qmui_badgeFont, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_badgeFont = qmui_badgeFont;
self.qmui_selectedView.qmui_badgeFont = qmui_badgeFont;
}

- (UIFont *)qmui_badgeFont {
Expand All @@ -127,6 +131,7 @@ - (UIFont *)qmui_badgeFont {
- (void)setQmui_badgeContentEdgeInsets:(UIEdgeInsets)qmui_badgeContentEdgeInsets {
objc_setAssociatedObject(self, &kAssociatedObjectKey_badgeContentEdgeInsets, [NSValue valueWithUIEdgeInsets:qmui_badgeContentEdgeInsets], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_badgeContentEdgeInsets = qmui_badgeContentEdgeInsets;
self.qmui_selectedView.qmui_badgeContentEdgeInsets = qmui_badgeContentEdgeInsets;
}

- (UIEdgeInsets)qmui_badgeContentEdgeInsets {
Expand All @@ -137,6 +142,7 @@ - (UIEdgeInsets)qmui_badgeContentEdgeInsets {
- (void)setQmui_badgeOffset:(CGPoint)qmui_badgeOffset {
objc_setAssociatedObject(self, &kAssociatedObjectKey_badgeOffset, @(qmui_badgeOffset), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_badgeOffset = qmui_badgeOffset;
self.qmui_selectedView.qmui_badgeOffset = qmui_badgeOffset;
}

- (CGPoint)qmui_badgeOffset {
Expand All @@ -147,6 +153,7 @@ - (CGPoint)qmui_badgeOffset {
- (void)setQmui_badgeOffsetLandscape:(CGPoint)qmui_badgeOffsetLandscape {
objc_setAssociatedObject(self, &kAssociatedObjectKey_badgeOffsetLandscape, @(qmui_badgeOffsetLandscape), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_badgeOffsetLandscape = qmui_badgeOffsetLandscape;
self.qmui_selectedView.qmui_badgeOffsetLandscape = qmui_badgeOffsetLandscape;
}

- (CGPoint)qmui_badgeOffsetLandscape {
Expand All @@ -155,6 +162,8 @@ - (CGPoint)qmui_badgeOffsetLandscape {

- (void)setQmui_badgeView:(__kindof UIView *)qmui_badgeView {
self.qmui_view.qmui_badgeView = qmui_badgeView;
/// iOS 26,需要改成block?
// self.qmui_selectedView.qmui_badgeView = qmui_badgeView;
}

- (__kindof UIView *)qmui_badgeView {
Expand All @@ -163,6 +172,7 @@ - (__kindof UIView *)qmui_badgeView {

- (void)setQmui_badgeViewDidLayoutBlock:(void (^)(__kindof UIView * _Nonnull, __kindof UIView * _Nonnull))qmui_badgeViewDidLayoutBlock {
self.qmui_view.qmui_badgeViewDidLayoutBlock = qmui_badgeViewDidLayoutBlock;
self.qmui_selectedView.qmui_badgeViewDidLayoutBlock = qmui_badgeViewDidLayoutBlock;
}

- (void (^)(__kindof UIView * _Nonnull, __kindof UIView * _Nonnull))qmui_badgeViewDidLayoutBlock {
Expand All @@ -178,6 +188,7 @@ - (void)setQmui_shouldShowUpdatesIndicator:(BOOL)qmui_shouldShowUpdatesIndicator
[self updateViewDidSetBlockIfNeeded];
}
self.qmui_view.qmui_shouldShowUpdatesIndicator = qmui_shouldShowUpdatesIndicator;
self.qmui_selectedView.qmui_shouldShowUpdatesIndicator = qmui_shouldShowUpdatesIndicator;
}

- (BOOL)qmui_shouldShowUpdatesIndicator {
Expand All @@ -188,6 +199,7 @@ - (BOOL)qmui_shouldShowUpdatesIndicator {
- (void)setQmui_updatesIndicatorColor:(UIColor *)qmui_updatesIndicatorColor {
objc_setAssociatedObject(self, &kAssociatedObjectKey_updatesIndicatorColor, qmui_updatesIndicatorColor, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_updatesIndicatorColor = qmui_updatesIndicatorColor;
self.qmui_selectedView.qmui_updatesIndicatorColor = qmui_updatesIndicatorColor;
}

- (UIColor *)qmui_updatesIndicatorColor {
Expand All @@ -198,6 +210,7 @@ - (UIColor *)qmui_updatesIndicatorColor {
- (void)setQmui_updatesIndicatorSize:(CGSize)qmui_updatesIndicatorSize {
objc_setAssociatedObject(self, &kAssociatedObjectKey_updatesIndicatorSize, [NSValue valueWithCGSize:qmui_updatesIndicatorSize], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_updatesIndicatorSize = qmui_updatesIndicatorSize;
self.qmui_selectedView.qmui_updatesIndicatorSize = qmui_updatesIndicatorSize;
}

- (CGSize)qmui_updatesIndicatorSize {
Expand All @@ -208,6 +221,7 @@ - (CGSize)qmui_updatesIndicatorSize {
- (void)setQmui_updatesIndicatorOffset:(CGPoint)qmui_updatesIndicatorOffset {
objc_setAssociatedObject(self, &kAssociatedObjectKey_updatesIndicatorOffset, @(qmui_updatesIndicatorOffset), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_updatesIndicatorOffset = qmui_updatesIndicatorOffset;
self.qmui_selectedView.qmui_updatesIndicatorOffset = qmui_updatesIndicatorOffset;
}

- (CGPoint)qmui_updatesIndicatorOffset {
Expand All @@ -218,6 +232,7 @@ - (CGPoint)qmui_updatesIndicatorOffset {
- (void)setQmui_updatesIndicatorOffsetLandscape:(CGPoint)qmui_updatesIndicatorOffsetLandscape {
objc_setAssociatedObject(self, &kAssociatedObjectKey_updatesIndicatorOffsetLandscape, @(qmui_updatesIndicatorOffsetLandscape), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
self.qmui_view.qmui_updatesIndicatorOffsetLandscape = qmui_updatesIndicatorOffsetLandscape;
self.qmui_selectedView.qmui_updatesIndicatorOffsetLandscape = qmui_updatesIndicatorOffsetLandscape;
}

- (CGPoint)qmui_updatesIndicatorOffsetLandscape {
Expand All @@ -226,6 +241,8 @@ - (CGPoint)qmui_updatesIndicatorOffsetLandscape {

- (void)setQmui_updatesIndicatorView:(__kindof UIView *)qmui_updatesIndicatorView {
self.qmui_view.qmui_updatesIndicatorView = qmui_updatesIndicatorView;
/// iOS 26,需要改成block?
// self.qmui_selectedView.qmui_updatesIndicatorView = qmui_updatesIndicatorView;
}

- (UIView *)qmui_updatesIndicatorView {
Expand All @@ -234,6 +251,7 @@ - (UIView *)qmui_updatesIndicatorView {

- (void)setQmui_updatesIndicatorViewDidLayoutBlock:(void (^)(__kindof UIView * _Nonnull, __kindof UIView * _Nonnull))qmui_updatesIndicatorViewDidLayoutBlock {
self.qmui_view.qmui_updatesIndicatorViewDidLayoutBlock = qmui_updatesIndicatorViewDidLayoutBlock;
self.qmui_selectedView.qmui_updatesIndicatorViewDidLayoutBlock = qmui_updatesIndicatorViewDidLayoutBlock;
}

- (void (^)(__kindof UIView * _Nonnull, __kindof UIView * _Nonnull))qmui_updatesIndicatorViewDidLayoutBlock {
Expand All @@ -242,23 +260,75 @@ - (void)setQmui_updatesIndicatorViewDidLayoutBlock:(void (^)(__kindof UIView * _

#pragma mark - Common

- (nullable UIView *)qmui_selectedView {
if (QMUIHelper.isUsedLiquidGlass) {
if (![self isKindOfClass:UITabBarItem.class]) {
return nil;
}
UIView *view = self.qmui_view;
if (!view) {
return nil;
}
NSInteger index = [view.superview.subviews indexOfObject:view];
if (index == NSNotFound) {
return nil;
}
UIView *platterView = view.superview.superview;
if (![NSStringFromClass(platterView.class) hasSuffix:@"_UITabBarPlatterView"]) {
return nil;
}
UIView *selectedContentView = platterView.subviews.firstObject;
if (![NSStringFromClass(selectedContentView.class) hasSuffix:@"SelectedContentView"]) {
return nil;
}
if (index < selectedContentView.subviews.count) {
UIView *selectedView = [selectedContentView.subviews objectAtIndex:index];
return selectedView;
}
}
return nil;
}

- (void)updateViewDidSetBlockIfNeeded {
if (!self.qmui_viewDidSetBlock) {
self.qmui_viewDidSetBlock = ^(__kindof UIBarItem * _Nonnull item, UIView * _Nullable view) {
UIView *selectedView = item.qmui_selectedView;

view.qmui_badgeBackgroundColor = item.qmui_badgeBackgroundColor;
selectedView.qmui_badgeBackgroundColor = item.qmui_badgeBackgroundColor;

view.qmui_badgeTextColor = item.qmui_badgeTextColor;
selectedView.qmui_badgeTextColor = item.qmui_badgeTextColor;

view.qmui_badgeFont = item.qmui_badgeFont;
selectedView.qmui_badgeFont = item.qmui_badgeFont;

view.qmui_badgeContentEdgeInsets = item.qmui_badgeContentEdgeInsets;
selectedView.qmui_badgeContentEdgeInsets = item.qmui_badgeContentEdgeInsets;

view.qmui_badgeOffset = item.qmui_badgeOffset;
selectedView.qmui_badgeOffset = item.qmui_badgeOffset;

view.qmui_badgeOffsetLandscape = item.qmui_badgeOffsetLandscape;
selectedView.qmui_badgeOffsetLandscape = item.qmui_badgeOffsetLandscape;

view.qmui_updatesIndicatorColor = item.qmui_updatesIndicatorColor;
selectedView.qmui_updatesIndicatorColor = item.qmui_updatesIndicatorColor;

view.qmui_updatesIndicatorSize = item.qmui_updatesIndicatorSize;
selectedView.qmui_updatesIndicatorSize = item.qmui_updatesIndicatorSize;

view.qmui_updatesIndicatorOffset = item.qmui_updatesIndicatorOffset;
selectedView.qmui_updatesIndicatorOffset = item.qmui_updatesIndicatorOffset;

view.qmui_updatesIndicatorOffsetLandscape = item.qmui_updatesIndicatorOffsetLandscape;
selectedView.qmui_updatesIndicatorOffsetLandscape = item.qmui_updatesIndicatorOffsetLandscape;

view.qmui_badgeString = item.qmui_badgeString;
selectedView.qmui_badgeString = item.qmui_badgeString;

view.qmui_shouldShowUpdatesIndicator = item.qmui_shouldShowUpdatesIndicator;
selectedView.qmui_shouldShowUpdatesIndicator = item.qmui_shouldShowUpdatesIndicator;
};

// 为 qmui_viewDidSetBlock 赋值前 item 已经 set 完 view,则手动触发一次
Expand Down
2 changes: 1 addition & 1 deletion QMUIKit/QMUIComponents/QMUIBadge/UIView+QMUIBadge.m
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ - (void)updateLayoutSubviewsBlockIfNeeded {
// 不管 image 还是 text 的 UIBarButtonItem 都获取内部的 _UIModernBarButton 即可
- (UIView *)findBarButtonContentView {
NSString *classString = NSStringFromClass(self.class);
if ([classString isEqualToString:@"UITabBarButton"]) {
if ([classString isEqualToString:@"UITabBarButton"] || [classString isEqualToString:@"_UITabButton"]) {
// 特别的,对于 UITabBarItem,将 imageView 作为参考 view
UIView *imageView = [UITabBarItem qmui_imageViewInTabBarButton:self];
return imageView;
Expand Down
Loading