Categories
The following categories are available globally.
-
配合 QMUIStaticTableViewCellDataSource 使用,主要负责:
- 提供 property 去绑定一个 static dataSource
- 重写 setDataSource:、setDelegate: 方法,自动实现 UITableViewDataSource、UITableViewDelegate 里一些必要的方法
使用方式:初始化一个 QMUIStaticTableViewCellDataSource 并将其赋值给 qmui_staticCellDataSource 属性即可。
Warning
当要动态更新 dataSource 时,可直接修改 self.qmui_staticCellDataSource.cellDataSections 数组,或者创建一个新的 QMUIStaticTableViewCellDataSource。不管用哪种方法,都不需要手动调用 reloadData,tableView 会自动刷新的。Declaration
Objective-C
@interface UITableView (QMUI_StaticCell)
-
Undocumented
See moreDeclaration
Objective-C
@interface UIViewController (QMUIModalPresentationViewController) /** * 获取弹出当前 vieController 的 QMUIModalPresentationViewController */ @property(nullable, nonatomic, weak, readonly) QMUIModalPresentationViewController *qmui_modalPresentationViewController; @end
-
自动缓存 self-sizing cell 的高度,避免重复计算。使用方法:
- 将 tableView.qmui_cacheCellHeightByKeyAutomatically = YES
- 实现 tableView 的 delegate 方法 qmui_tableView:cacheKeyForRowAtIndexPath: 返回一个 key。建议 key 由所有可能影响高度的字段拼起来,这样当数据发生变化时不需要手动更新缓存。
Note
注意这里的高度缓存仅适合于使用 self-sizing 机制的 tableView(也即 tableView.rowHeight = UITableViewAutomaticDimension),QMUICellHeightKeyCache 会自动在 willDisplayCell 里将 cell 的当前高度缓存起来,然后在 heightForRow 里从缓存中读取高度后使用。Note
如果 tableView 开启了 qmui_cacheCellHeightByKeyAutomatically 并且 tableView.delegate 实现了 tableView:heightForRowAtIndexPath:,如果返回值 >= 0则使用这个返回值当成最终的高度,如果 < 0 则交给 QMUICellHeightKeyCache 自己处理。Note
如果 tableView 开启了 qmui_cacheCellHeightByKeyAutomatically 并且 tableView.delegate 实现了 tableView:estimatedHeightForRowAtIndexPath:,则当该 indexPath 所在的 cell 的高度已经被计算过的情况下,业务自己的 tableView:estimatedHeightForRowAtIndexPath: 不会被调用,只有当高度缓存里找不到该 indexPath 对应的 key 的缓存时,才会调用业务的这个方法。
Note
在 UITableView 的宽度和 contentInset、safeAreaInsets 发生变化时(例如横竖屏旋转、iPad 分屏),高度缓存会自动刷新,所以无需为这种情况做保护。
Declaration
Objective-C
@interface UITableView (QMUICellHeightKeyCache)
-
Undocumented
See moreDeclaration
Objective-C
@interface NSObject (QMUIWindowSizeMonitor) /** 为当前对象添加主窗口 (UIApplication Delegate Window)的大小变化的监听,同一对象可重复添加多个监听,当对象销毁时监听自动失效。 @param handler 窗口大小发生改变时的回调 */ - (void)qmui_addSizeObserverForMainWindow:(QMUIWindowSizeObserverHandler)handler; /** 为当前对象添加指定窗口的大小变化监听,同一对象可重复添加多个监听,当对象销毁时监听自动失效。 @param window 要监听的窗口 @param handler 窗口大小发生改变时的回调 */ - (void)qmui_addSizeObserverForWindow:(UIWindow *)window handler:(QMUIWindowSizeObserverHandler)handler; @end
-
注意,这个类的功能暂无法使用
See moreDeclaration
Objective-C
@interface UICollectionView (QMUICellSizeKeyCache)
-
Undocumented
See moreDeclaration
Objective-C
@interface PHPhotoLibrary (QMUI) /** * 根据 contentType 的值产生一个合适的 PHFetchOptions,并把内容以资源创建日期排序,创建日期较新的资源排在前面 * * @param contentType 相册的内容类型 * * @return 返回一个合适的 PHFetchOptions */ + (PHFetchOptions *)createFetchOptionsWithAlbumContentType:(QMUIAlbumContentType)contentType; /** * 获取所有相册 * * @param contentType 相册的内容类型,设定了内容类型后,所获取的相册中只包含对应类型的资源 * @param showEmptyAlbum 是否显示空相册(经过 contentType 过滤后仍为空的相册) * @param showSmartAlbum 是否显示“智能相册” * * @return 返回包含所有合适相册的数组 */ + (NSArray<PHAssetCollection *> *)fetchAllAlbumsWithAlbumContentType:(QMUIAlbumContentType)contentType showEmptyAlbum:(BOOL)showEmptyAlbum showSmartAlbum:(BOOL)showSmartAlbum; /// 获取一个 PHAssetCollection 中创建日期最新的资源 + (PHAsset *)fetchLatestAssetWithAssetCollection:(PHAssetCollection *)assetCollection; /** * 保存图片或视频到指定的相册 * * @warning 无论用户保存到哪个自行创建的相册,系统都会在“相机胶卷”相册中同时保存这个图片。 * 原因请参考 QMUIAssetsManager 对象的保存图片和视频方法的注释。 * @warning 无法通过该方法把图片保存到“智能相册”,“智能相册”只能由系统控制资源的增删。 */ - (void)addImageToAlbum:(CGImageRef)imageRef albumAssetCollection:(PHAssetCollection *)albumAssetCollection orientation:(UIImageOrientation)orientation completionHandler:(void(^)(BOOL success, NSDate *creationDate, NSError *error))completionHandler; - (void)addImageToAlbum:(NSURL *)imagePathURL albumAssetCollection:(PHAssetCollection *)albumAssetCollection completionHandler:(void(^)(BOOL success, NSDate *creationDate, NSError *error))completionHandler; - (void)addVideoToAlbum:(NSURL *)videoPathURL albumAssetCollection:(PHAssetCollection *)albumAssetCollection completionHandler:(void(^)(BOOL success, NSDate *creationDate, NSError *error))completionHandler; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UIColor (QMUITheme) /** 生成一个动态的 color 对象,每次使用该颜色时都会动态根据当前的 QMUIThemeManager 主题返回对应的颜色。 @param provider 当 color 被使用时,这个 provider 会被调用,返回对应当前主题的 color 值。请不要在这个 block 里做耗时操作。 @return 当前主题下的实际色值,由 provider 返回 */ + (UIColor *)qmui_colorWithThemeProvider:(UIColor *(^)(__kindof QMUIThemeManager *manager, __kindof NSObject<NSCopying> * _Nullable identifier, __kindof NSObject * _Nullable theme))provider; /** 生成一个动态的 color 对象,每次使用该颜色时都会动态根据当前的 QMUIThemeManager name 和主题返回对应的颜色。 @param name themeManager 的 name,用于区分不同维度的主题管理器 @param provider 当 color 被使用时,这个 provider 会被调用,返回对应当前主题的 color 值。请不要在这个 block 里做耗时操作。 @return 当前主题下的实际色值,由 provider 返回 */ + (UIColor *)qmui_colorWithThemeManagerName:(__kindof NSObject<NSCopying> *)name provider:(UIColor *(^)(__kindof QMUIThemeManager *manager, __kindof NSObject<NSCopying> * _Nullable identifier, __kindof NSObject * _Nullable theme))provider; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UIVisualEffect (QMUITheme) <QMUIDynamicEffectProtocol> /** 生成一个动态的 UIVisualEffect 对象,每次使用该对象时都会动态根据当前的 QMUIThemeManager 主题返回对应的 effect。 @param provider 当 UIVisualEffect 被使用时,这个 provider 会被调用,返回对应当前主题的 effect 值。请不要在这个 block 里做耗时操作。 @return 一个动态的 UIVisualEffect 对象,被使用时才会返回实际的 effect 效果 */ + (UIVisualEffect *)qmui_effectWithThemeProvider:(UIVisualEffect *(^)(__kindof QMUIThemeManager *manager, __kindof NSObject<NSCopying> * _Nullable identifier, __kindof NSObject * _Nullable theme))provider; /** 生成一个动态的 UIVisualEffect 对象,每次使用该对象时都会动态根据当前的 QMUIThemeManager name 和主题返回对应的 effect。 @param name themeManager 的 name,用于区分不同维度的主题管理器 @param provider 当 UIVisualEffect 被使用时,这个 provider 会被调用,返回对应当前主题的 effect 值。请不要在这个 block 里做耗时操作。 @return 一个动态的 UIVisualEffect 对象,被使用时才会返回实际的 effect 效果 */ + (UIVisualEffect *)qmui_effectWithThemeManagerName:(__kindof NSObject<NSCopying> *)name provider:(UIVisualEffect *(^)(__kindof QMUIThemeManager *manager, __kindof NSObject<NSCopying> * _Nullable identifier, __kindof NSObject * _Nullable theme))provider; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UIView (QMUITheme) /** 注册当前 view 里需要在主题变化时被重新设置的 property,当主题变化时,会通过 qmui_themeDidChangeByManager:identifier:theme: 来重新调用一次 self.xxx = xxx,以达到刷新界面的目的。 @param getters 属性的 getter, 内部会根据命名规则自动转换得到 setter,再通过 performSelector 的形式调用 getter 和 setter */ - (void)qmui_registerThemeColorProperties:(NSArray<NSString *> *)getters; /** 注销通过 qmui_registerThemeColorProperties: 注册的 property @param getters 属性的 getter, 内部会根据命名规则自动转换得到 setter,再通过 performSelector 的形式调用 getter 和 setter */ - (void)qmui_unregisterThemeColorProperties:(NSArray<NSString *> *)getters; /** 当主题变化时这个方法会被调用,通过 registerThemeColorProperties: 方法注册的属性也会在这里被更新(所以记得要调用 super)。registerThemeColorProperties: 无法满足的需求可以重写这个方法自行实现。 @param manager 当前的主题管理对象 @param identifier 当前主题的标志,可自行修改参数类型为目标类型 @param theme 当前主题对象,可自行修改参数类型为目标类型 */ - (void)qmui_themeDidChangeByManager:(nullable QMUIThemeManager *)manager identifier:(nullable __kindof NSObject<NSCopying> *)identifier theme:(nullable __kindof NSObject *)theme NS_REQUIRES_SUPER; @property(nonatomic, copy, nullable) void (^qmui_themeDidChangeBlock)(void); @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UIImage (QMUITheme) <QMUIDynamicImageProtocol> /** 生成一个动态的 image 对象,每次使用该图片时都会动态根据当前的 QMUIThemeManager 主题返回对应的图片。 @param provider 当 image 被使用时,这个 provider 会被调用,返回对应当前主题的 image 值 @return 当前主题下的实际图片,由 provider 返回 */ + (UIImage *)qmui_imageWithThemeProvider:(UIImage *(^)(__kindof QMUIThemeManager *manager, __kindof NSObject<NSCopying> * _Nullable identifier, __kindof NSObject * _Nullable theme))provider; /** 生成一个动态的 image 对象,每次使用该图片时都会动态根据当前的 QMUIThemeManager name 和主题返回对应的图片。 @param name themeManager 的 name,用于区分不同维度的主题管理器 @param provider 当 image 被使用时,这个 provider 会被调用,返回对应当前主题的 image 值 @return 当前主题下的实际图片,由 provider 返回 */ + (UIImage *)qmui_imageWithThemeManagerName:(__kindof NSObject<NSCopying> *)name provider:(UIImage *(^)(__kindof QMUIThemeManager *manager, __kindof NSObject<NSCopying> * _Nullable identifier, __kindof NSObject * _Nullable theme))provider; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UIViewController (QMUITheme) /** 当主题变化时这个方法会被调用 @param manager 当前的主题管理对象 @param identifier 当前主题的标志,可自行修改参数类型为目标类型 @param theme 当前主题对象,可自行修改参数类型为目标类型 */ - (void)qmui_themeDidChangeByManager:(QMUIThemeManager *)manager identifier:(__kindof NSObject<NSCopying> *)identifier theme:(__kindof NSObject *)theme NS_REQUIRES_SUPER; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UIView (QMUITheme_Private) - (void)_qmui_themeDidChangeByManager:(nullable QMUIThemeManager *)manager identifier:(nullable __kindof NSObject<NSCopying> *)identifier theme:(nullable __kindof NSObject *)theme shouldEnumeratorSubviews:(BOOL)shouldEnumeratorSubviews; @property(nonatomic, strong) UIColor *qmuiTheme_backgroundColor; /// 记录当前 view 总共有哪些 property 需要在 theme 变化时重新设置 @property(nonatomic, strong) NSMutableDictionary<NSString *, NSString *> *qmuiTheme_themeColorProperties; - (BOOL)_qmui_visible; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface CAAnimation (QMUI) @property(nonatomic, copy) void (^qmui_animationDidStartBlock)(__kindof CAAnimation *aAnimation); @property(nonatomic, copy) void (^qmui_animationDidStopBlock)(__kindof CAAnimation *aAnimation, BOOL finished); @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UINavigationBar (Transition) /// 用来模仿真的navBar,配合 UINavigationController+NavigationBarTransition 在转场过程中存在的一条假navBar @property(nonatomic, strong) UINavigationBar *transitionNavigationBar; @end
-
让所有 NSObject 都支持多个 delegate,默认只支持属性名为 delegate 的 delegate(特别地,UITableView 和 UICollectionView 额外默认支持 dataSource)。 使用方式:将 qmui_multipleDelegatesEnabled 置为 YES 后像平时一样 self.delegate = xxx 即可。 如果你要清掉所有的 delegate,则像平时一样 self.delegate = nil 即可。 如果你把 delegate 同时赋值给 objA 和 objB,而你只要移除 objB,则可:[self qmui_removeDelegate:objB]
如果你要让其他命名的 delegate 属性也支持多 delegate,则可调用 qmui_registerDelegateSelector: 方法将该属性的 getter 传进去,再进行实际的 delegate 赋值,例如你的 delegate 命名为 abcDelegate,则你可以这么写: [self qmui_registerDelegateSelector:@selector(abcDelegate)]; self.abcDelegate = delegateA; self.abcDelegate = delegateB;
Warning
不支持 self.delegate = self 的写法,会引发死循环,有这种需求的场景建议在 self 内部创建一个对象专门用于 delegate 的响应,参考 _QMUITextViewDelegator。Declaration
Objective-C
@interface NSObject (QMUIMultipleDelegates)
-
用于在 UIBarButtonItem(通常用于 UINavigationBar 和 UIToolbar)和 UITabBarItem 上显示未读红点或者未读数。对设置的时机没有要求。所有属性在 QMUIConfigurationTemplate 配置表里均提供对应的默认值设置,如果你不使用配置表,则所有属性的默认值均为 0。
Note
系统对 UIBarButtonItem 和 UITabBarItem 在横竖屏下均会有不同的布局,当你使用本控件时建议分别检查横竖屏下的表现是否正确。Declaration
Objective-C
@interface UIBarItem (QMUIBadge)
-
Undocumented
See moreDeclaration
Objective-C
@interface UIBarButtonItem (QMUINavigationButton) + (instancetype)qmui_itemWithButton:(nullable QMUINavigationButton *)button target:(nullable id)target action:(nullable SEL)action; + (instancetype)qmui_itemWithImage:(nullable UIImage *)image target:(nullable id)target action:(nullable SEL)action; + (instancetype)qmui_itemWithTitle:(nullable NSString *)title target:(nullable id)target action:(nullable SEL)action; + (instancetype)qmui_itemWithBoldTitle:(nullable NSString *)title target:(nullable id)target action:(nullable SEL)action; + (instancetype)qmui_backItemWithTitle:(nullable NSString *)title target:(nullable id)target action:(nullable SEL)action; + (instancetype)qmui_backItemWithTarget:(nullable id)target action:(nullable SEL)action; + (instancetype)qmui_closeItemWithTarget:(nullable id)target action:(nullable SEL)action; + (instancetype)qmui_fixedSpaceItemWithWidth:(CGFloat)width; + (instancetype)qmui_flexibleSpaceItem; @end
-
UITableView 定义了一套动态计算 cell 高度的方式:
其思路是参考开源代码:https://github.com/forkingdog/UITableView-FDTemplateLayoutCell。
- cell 必须实现 sizeThatFits: 方法,在里面计算自身的高度并返回
- 初始化一个 QMUITableView,并为其指定一个 QMUITableViewDataSource
- 实现 qmui_tableView:cellWithIdentifier: 方法,在里面为不同的 identifier 创建不同的 cell 实例
- 在 tableView:cellForRowAtIndexPath: 里使用 qmui_tableView:cellWithIdentifier: 获取 cell
- 在 tableView:heightForRowAtIndexPath: 里使用 UITableView (QMUILayoutCell) 提供的几种方法得到 cell 的高度
- 当某个 cell 的缓存需要主动刷新时,请调用 UITableView 的 qmui_invalidateXxx 系列方法。
这套方式的好处是 tableView 能直接操作 cell 的实例,cell 无需增加额外的专门用于获取 cell 高度的方法。并且这套方式支持基本的高度缓存(可按 key 缓存或按 indexPath 缓存),若使用了缓存,请注意在适当的时机去更新缓存(例如某个 cell 的内容发生变化,可能 cell 的高度也会变化,则需要更新这个 cell 已被缓存起来的高度)。
使用这套方式额外的消耗是每个 identifier 都会生成一个多余的 cell 实例(专用于高度计算),但大部分情况下一个生成一个 cell 实例并不会带来过多的负担,所以一般不用担心这个问题。
Note
当 tableView 的宽度发生变化时,缓存会自动刷新,所以无需自己监听横竖屏旋转、viewWillTransitionToSize: 等事件。
Note
注意,如果你的 tableView 可以使用 estimatedRowHeight,则建议使用 UITableView (QMUICellHeightKeyCache) 代替本控件,可节省大量代码。
See
UITableView (QMUICellHeightKeyCache)
Declaration
Objective-C
@interface UITableView (QMUILayoutCell)
-
Undocumented
See moreDeclaration
Objective-C
@interface UITableView (QMUIKeyedHeightCache) /// 在 UITableView 不同的宽度下会得到不一样的 QMUICellHeightCache 实例,从而保证宽度变化时缓存自动刷新 @property(nonatomic, strong, readonly) QMUICellHeightCache *qmui_keyedHeightCache; /// 搭配 QMUICellHeightCache,清除指定 key 的高度缓存,注意请不要直接使用 [self.qmui_keyedHeightCache invalidateHeightForKey:],因为一个 UITableView 在不同宽度下会有不同的 QMUICellHeightCache,直接使用那个 cache 的 invalidate 方法只能刷新当前的 cache,无法刷新其他宽度下的 cache。 - (void)qmui_invalidateHeightForKey:(id<NSCopying>)key; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UITableView (QMUICellHeightIndexPathCache) /// YES 表示在 reloadData、reloadIndexPath: 等方法被调用时,对应的缓存也会被自动更新,默认为 YES。仅对 indexPath 方式的缓存有效。 @property(nonatomic, assign) BOOL qmui_invalidateIndexPathHeightCachedAutomatically; /// 在 UICollectionView 不同的大小下会得到不一样的 QMUICellHeightIndexPathCache 实例,从而保证大小变化时缓存自动刷新 @property(nonatomic, strong, readonly) QMUICellHeightIndexPathCache *qmui_indexPathHeightCache; /// 搭配 QMUICellHeightIndexPathCache,清除指定 indexPath 的高度缓存,注意请不要直接使用 [self.qmui_indexPathHeightCache invalidateHeightAtIndexPath:],因为一个 UITableView 在不同宽度下会有不同的 QMUICellHeightIndexPathCache,直接使用那个 cache 的 invalidate 方法只能刷新当前的 cache,无法刷新其他宽度下的 cache。 - (void)qmui_invalidateHeightAtIndexPath:(NSIndexPath *)indexPath; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UITableView (QMUIIndexPathHeightCacheInvalidation) /// 当需要 reloadData 的时候,又不想使缓存失效,可以调用下面这个方法。注意,仅在 qmui_invalidateIndexPathHeightCachedAutomatically 为 YES 时才有意义。 - (void)qmui_reloadDataWithoutInvalidateIndexPathHeightCache; @end
-
UICollectionView 定义了一套动态计算 cell 高度的方式。 原理类似 UITableView,具体请参考 UITableView (QMUILayoutCell)。
See moreDeclaration
Objective-C
@interface UICollectionView (QMUIKeyedHeightCache)
-
Undocumented
See moreDeclaration
Objective-C
@interface UICollectionView (QMUICellHeightIndexPathCache) /// YES 表示在 reloadData、reloadIndexPath: 等方法被调用时,对应的缓存也会被自动更新,默认为 YES。仅对 indexPath 方式的缓存有效。 @property(nonatomic, assign) BOOL qmui_invalidateIndexPathHeightCachedAutomatically; /// 在 UICollectionView 不同的大小下会得到不一样的 QMUICellHeightIndexPathCache 实例,从而保证大小变化时缓存自动刷新 @property(nonatomic, strong, readonly) QMUICellHeightIndexPathCache *qmui_indexPathHeightCache; /// 搭配 QMUICellHeightIndexPathCache,清除指定 indexPath 的高度缓存,注意请不要直接使用 [self.qmui_indexPathHeightCache invalidateHeightAtIndexPath:],因为一个 UICollectionView 在不同宽度下会有不同的 QMUICellHeightIndexPathCache,直接使用那个 cache 的 invalidate 方法只能刷新当前的 cache,无法刷新其他宽度下的 cache。 - (void)qmui_invalidateHeightAtIndexPath:(NSIndexPath *)indexPath; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UICollectionView (QMUIIndexPathHeightCacheInvalidation) /// 当需要 reloadData 的时候,又不想使缓存失效,可以调用下面这个方法。注意,仅在 qmui_invalidateIndexPathHeightCachedAutomatically 为 YES 时才有意义。 - (void)qmui_reloadDataWithoutInvalidateIndexPathHeightCache; @end
-
以下接口可在“sizeForItemAtIndexPath”里面调用来计算高度 通过构建一个cell模拟真正显示的cell,给cell设置真实的数据,然后再调用cell的sizeThatFits:来计算高度 也就是说我们自定义的cell里面需要重写sizeThatFits:并返回正确的值
See moreDeclaration
Objective-C
@interface UICollectionView (QMUILayoutCell)
-
Undocumented
See moreDeclaration
Objective-C
@interface UIResponder (KeyboardManager) /// 持有KeyboardManager对象 @property(nonatomic, strong) QMUIKeyboardManager *qmui_keyboardManager; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UITextField (QMUI_KeyboardManager) /// 键盘相关block,搭配QMUIKeyboardManager一起使用 @property(nonatomic, copy) void (^qmui_keyboardWillShowNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardWillHideNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardWillChangeFrameNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardDidShowNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardDidHideNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardDidChangeFrameNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UITextView (QMUI_KeyboardManager) /// 键盘相关block,搭配QMUIKeyboardManager一起使用 @property(nonatomic, copy) void (^qmui_keyboardWillShowNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardWillHideNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardWillChangeFrameNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardDidShowNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardDidHideNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @property(nonatomic, copy) void (^qmui_keyboardDidChangeFrameNotificationBlock)(QMUIKeyboardUserInfo *keyboardUserInfo); @end
-
Undocumented
See moreDeclaration
Objective-C
@interface CALayer (QMUIViewAnimation) /** 开启了该属性的 CALayer 可在 +[UIView animateWithDuration:animations:] 执行动画,系统默认是不支持这种做法的。 @code [UIView animateWithDuration:1 animations:^{ layer.frame = xxx; } completion:nil]; @endcode */ @property(nonatomic, assign) BOOL qmui_viewAnimaitonEnabled; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface NSObject (QMUIAppearnace) /** 从 appearance 里取值并赋值给当前实例,通常在对象的 init 里调用(只要在实例初始化后、使用前就可以)。适用于 QMUIAppearance 和系统的 UIAppearance。 */ - (void)qmui_applyAppearance; @end