Protocols

The following protocols are available globally.

  • 拦截系统默认返回按钮事件,有时候需要在点击系统返回按钮,或者手势返回的时候想要拦截事件,比如要判断当前界面编辑的的内容是否要保存,或者返回的时候需要做一些额外的逻辑处理等等。

    See more

    Declaration

    Objective-C

    @protocol UINavigationControllerBackButtonHandlerProtocol <NSObject>

    Swift

    protocol UINavigationControllerBackButtonHandlerProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol QMUIDynamicColorProtocol <NSObject>
    
    @required
    
    /// 获取当前 color 的实际颜色(返回的颜色必定不是 dynamic color)
    @property(nonatomic, strong, readonly) UIColor *qmui_rawColor;
    
    /// 标志当前 UIColor 对象是否为动态颜色(由 [UIColor qmui_colorWithThemeProvider:] 创建的颜色,或者 iOS 13 下由 [UIColor colorWithDynamicProvider:]、[UIColor initWithDynamicProvider:] 创建的颜色)
    @property(nonatomic, assign, readonly) BOOL qmui_isDynamicColor;
    
    /// 标志当前 UIColor 对象是否为 QMUIThemeColor
    @property(nonatomic, assign, readonly) BOOL qmui_isQMUIDynamicColor;
    
    @optional
    /// 这方法其实是 iOS 13 新增的 UIDynamicColor 里的私有方法,只要任意 UIColor 的类实现这个方法并返回 YES,就能自动响应 iOS 13 下的 UIUserInterfaceStyle 的切换,这里在 protocol 里声明是为了方便 .m 里调用(否则会因为不存在的 selector 而无法编译)
    @property(nonatomic, assign, readonly) BOOL _isDynamic;
    
    @end

    Swift

    protocol QMUIDynamicColorProtocol : NSObjectProtocol