FWThemeManager
@interface FWThemeManager : NSObject
主题管理器,iOS13+可跟随系统改变
Note
框架默认只拦截了UIView|UIViewController|UIScreen|UIImageView|UILabel类,满足条件会自动触发fwThemeChanged;如果不满足条件或者拦截未生效,需先设置主题上下文fwThemeContext才能生效 注意事项:iOS13以下默认不支持主题切换;如需支持,请使用fwColor相关方法-
单例模式
Declaration
Objective-C
@property (class, nonatomic, readonly) FWThemeManager *_Nonnull sharedInstance;
-
当前主题模式,默认跟随系统模式
Declaration
Objective-C
@property (nonatomic) FWThemeMode mode;
-
iOS13切换主题模式时是否覆盖主window样式(立即生效),默认NO(不会立即生效,需刷新界面)。如果不满足需求,可自定义处理
Declaration
Objective-C
@property (nonatomic) BOOL overrideWindow;
-
当前全局主题样式
Declaration
Objective-C
@property (nonatomic, readonly) FWThemeStyle style;
-
指定traitCollection的实际显示样式,传nil时为全局样式
Declaration
Objective-C
- (FWThemeStyle)styleForTraitCollection: (nullable UITraitCollection *)traitCollection;