Classes
The following classes are available globally.
-
自动加载器,处理swift不支持load方法问题
Note
本方案采用objc扩展方法实现,相对于全局扫描类方案性能高(1/200),使用简单 使用方法:新增FWAutoloader扩展objc类方法,以load开头即会自动调用,注意方法名不要重复,建议load+类名+扩展名Declaration
-
日志记录类。支持设置全局日志级别和自定义FWLogPlugin插件
See moreDeclaration
Objective-C
@interface FWLogger : NSObject
-
框架包装器
注意:当包装器方法中存在异步调用或者需要监听通知时,不能直接使用self,因为包装器随时可被释放。 可视情况使用base内部分类、weakBase或者内部target等方式解决,代码示例: __weak NSObject *weakBase = self.base; [self asyncMethod:^(){ [weakBase.fw syncMethod]; }];
[self.base innerAsyncMethod];
[self.base addTarget:self.innerTarget action:action forControlEvents:controlEvents];
See moreDeclaration
Objective-C
@interface FWObjectWrapper : NSObject
-
Undocumented
See moreDeclaration
Objective-C
@interface FWApplicationClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWDeviceClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWScreenClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWViewControllerWrapper : FWObjectWrapper
-
Declaration
Objective-C
@interface FWAppearance : NSObject
-
Undocumented
See moreDeclaration
Objective-C
@interface FWViewClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWViewWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWNavigationBarWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTabBarWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWToolbarWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTimerClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWGestureRecognizerWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWGestureRecognizerClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWControlWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWBarButtonItemWrapper : FWBarItemWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWBarButtonItemClassWrapper : FWBarItemClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWLabelWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTableViewCellWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTableViewCellClassWrapper : FWViewClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTableViewHeaderFooterViewWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTableViewHeaderFooterViewClassWrapper : FWViewClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTableViewWrapper : FWScrollViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWCollectionViewCellWrapper : FWCollectionReusableViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWCollectionViewCellClassWrapper : FWCollectionReusableViewClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWCollectionReusableViewWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWCollectionReusableViewClassWrapper : FWViewClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWCollectionViewWrapper : FWScrollViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWStringWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWStringClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWDataWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWDataClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWURLWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWURLClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWArrayWrapper<__covariant ObjectType> : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWMutableArrayWrapper<__covariant ObjectType> : FWArrayWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWMutableSetWrapper<__covariant ObjectType> : FWSetWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWDictionaryWrapper<__covariant KeyType, __covariant ValueType> : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWMutableDictionaryWrapper<__covariant KeyType, __covariant ValueType> : FWDictionaryWrapper
-
框架异常捕获类
See moreDeclaration
Objective-C
@interface FWException : NSObject
-
Undocumented
See moreDeclaration
Objective-C
@interface FWAttributedStringWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWAttributedStringClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWDateWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWDateClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTimerWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWUserDefaultsWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWUserDefaultsClassWrapper : FWClassWrapper
-
字体图标抽象基类,子类需继承
Note
Foundation icons: https://zurb.com/playground/foundation-icon-fonts-3#allicons FontAwesome: https://fontawesome.com/ ionicons: https://ionic.io/ionicons/ Octicons: https://primer.style/octicons/ Material: https://google.github.io/material-design-icons/#icons-for-ios
Declaration
Objective-C
@interface FWIcon : NSObject
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTextFieldWrapper : FWControlWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTextViewWrapper : FWScrollViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWBundleWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWBundleClassWrapper : FWClassWrapper
-
通用加载器,添加处理句柄后指定输入即可加载输出结果
See moreDeclaration
Objective-C
@interface FWLoader<__covariant InputType, __covariant OutputType> : NSObject
-
Undocumented
See moreDeclaration
Objective-C
@interface FWWindowWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWWindowClassWrapper : FWViewClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWNavigationControllerWrapper : FWViewControllerWrapper
-
插件管理器类。支持插件冷替换(使用插件前)和热替换(先释放插件)
Note
和Mediator对比如下: Plugin:和业务无关,侧重于工具类、基础设施、可替换,比如Toast、Loading等 Mediator: 和业务相关,侧重于架构、业务功能、模块化,比如用户模块,订单模块等Declaration
Objective-C
@interface FWPluginManager : NSObject
-
Undocumented
See moreDeclaration
Objective-C
@interface FWDisplayLinkClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWAnimationWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWLayerWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWGradientLayerWrapper : FWLayerWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWColorWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWColorClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWImageWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWImageClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWImageAssetWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWImageAssetClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWImageViewWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWFontClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWNavigationControllerClassWrapper : FWViewControllerClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWLabelClassWrapper : FWViewClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWButtonWrapper : FWControlWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWButtonClassWrapper : FWControlClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWScrollViewWrapper : FWViewWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWPageControlWrapper : FWControlWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWSliderWrapper : FWControlWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWSwitchWrapper : FWControlWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWFileManagerWrapper : FWObjectWrapper
-
Undocumented
Declaration
Objective-C
@interface FWBarItemClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWBarItemWrapper : FWObjectWrapper
-
Undocumented
Declaration
Objective-C
@interface FWTabBarControllerClassWrapper : FWViewControllerClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWSetClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWApplicationWrapper : FWObjectWrapper
-
Undocumented
Declaration
Objective-C
@interface FWTabBarClassWrapper : FWViewClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWToolbarClassWrapper : FWViewClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWNumberWrapper : FWObjectWrapper
-
Undocumented
Declaration
Objective-C
@interface FWNavigationBarClassWrapper : FWViewClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWControlClassWrapper : FWViewClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWLayerClassWrapper : FWClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWBezierPathClassWrapper : FWClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWSearchBarClassWrapper : FWViewClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWCollectionViewClassWrapper : FWScrollViewClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWGradientLayerClassWrapper : FWLayerClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWTabBarControllerWrapper : FWViewControllerWrapper
-
Undocumented
Declaration
Objective-C
@interface FWDictionaryClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWDeviceWrapper : FWObjectWrapper
-
Undocumented
Declaration
Objective-C
@interface FWSwitchClassWrapper : FWControlClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWScreenWrapper : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWURLRequestWrapper : FWObjectWrapper
-
Undocumented
Declaration
Objective-C
@interface FWFileManagerClassWrapper : FWClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWNumberClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWFontWrapper : FWObjectWrapper
-
Undocumented
Declaration
Objective-C
@interface FWMutableSetClassWrapper : FWSetClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWBezierPathWrapper : FWObjectWrapper
-
Undocumented
Declaration
Objective-C
@interface FWImageViewClassWrapper : FWViewClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWPageControlClassWrapper : FWControlClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWMutableDictionaryClassWrapper : FWClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWURLRequestClassWrapper : FWClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWDisplayLinkWrapper : FWObjectWrapper
-
Undocumented
Declaration
Objective-C
@interface FWScrollViewClassWrapper : FWViewClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWSliderClassWrapper : FWControlClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWMutableArrayClassWrapper : FWArrayClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWTextFieldClassWrapper : FWControlClassWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWSetWrapper<__covariant ObjectType> : FWObjectWrapper
-
Undocumented
See moreDeclaration
Objective-C
@interface FWSearchBarWrapper : FWViewWrapper
-
Undocumented
Declaration
Objective-C
@interface FWTableViewClassWrapper : FWScrollViewClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWAnimationClassWrapper : FWClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWViewControllerClassWrapper : FWClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWArrayClassWrapper : FWClassWrapper
-
Undocumented
Declaration
Objective-C
@interface FWTextViewClassWrapper : FWScrollViewClassWrapper
-
默认随机数仓库,存储于UserDefaults
See moreDeclaration
Swift
@objcMembers public class FWABDefaultRepository : NSObject, FWABRandomRepository
-
AB分离测试类
See moreDeclaration
Swift
@objcMembers public class FWABSplitTest : NSObject
-
AB条件测试类
See moreDeclaration
Swift
@objcMembers public class FWABConditionalTest : NSObject
-
时间调试器
See moreDeclaration
Swift
@objcMembers public class FWBenchmark : NSObject
-
框架约定类
See moreDeclaration
Swift
@objcMembers public class FWPromise : NSObject
-
Declaration
Objective-C
@interface FWLayoutChain : NSObject
-
位置服务
Note
注意:Info.plist需要添加NSLocationWhenInUseUsageDescription项 如果请求Always定位,还需添加NSLocationAlwaysUsageDescription项和NSLocationAlwaysAndWhenInUseUsageDescription项 iOS11可通过showsBackgroundLocationIndicator配置是否显示后台定位指示器Declaration
Objective-C
@interface FWLocationManager : NSObject
-
默认NSLog日志插件
See moreDeclaration
Objective-C
@interface FWLogPluginImpl : NSObject <FWLogPlugin>
-
Declaration
Objective-C
@interface FWMediator : NSObject
-
业务模块Bundle基类,各模块可继承
See moreDeclaration
Objective-C
@interface FWModuleBundle : NSObject
-
框架类包装器
注意:当包装器方法中存在异步调用或者需要监听通知时,不能直接使用self,因为包装器随时可被释放。 可视情况使用base内部分类、weakBase或者内部target等方式解决,代码示例: __weak NSObject *weakBase = self.base; [self asyncMethod:^(){ [weakBase.fw syncMethod]; }];
[self.base innerAsyncMethod];
[self.base addTarget:self.innerTarget action:action forControlEvents:controlEvents];
See moreDeclaration
Objective-C
@interface FWClassWrapper : NSObject
-
弱引用代理类,用于解决NSTimer和CADisplayLink中的循环引用target问题(默认NSTimer会强引用target,直到invalidate)
See moreDeclaration
Objective-C
@interface FWWeakProxy : NSProxy
-
弱引用对象容器类,用于解决关联对象weak引用等
See moreDeclaration
Objective-C
@interface FWWeakObject : NSObject
-
Declaration
Objective-C
@interface FWBlockProxy : NSObject
-
事件协议代理基类,可继承重写事件代理方法
See moreDeclaration
Objective-C
@interface FWDelegateProxy : NSObject
-
多代理转发类
See moreDeclaration
Objective-C
@interface FWMulticastDelegate<__covariant T> : NSObject
-
URL路由上下文
See moreDeclaration
Objective-C
@interface FWRouterContext : NSObject <NSCopying>
-
Declaration
Objective-C
@interface FWRouter : NSObject
-
状态事件类
See moreDeclaration
Objective-C
@interface FWStateEvent : NSObject
-
状态转换器
See moreDeclaration
Objective-C
@interface FWStateTransition : NSObject
-
Declaration
Objective-C
@interface FWStateMachine : NSObject
-
任务管理器,兼容NSBlockOperation和NSInvocationOperation
See moreDeclaration
Objective-C
@interface FWTaskManager : NSObject
-
主题管理器,iOS13+可跟随系统改变
Note
框架默认只拦截了UIView|UIViewController|UIScreen|UIImageView|UILabel类,满足条件会自动触发fwThemeChanged;如果不满足条件或者拦截未生效,需先设置主题上下文fwThemeContext才能生效 注意事项:iOS13以下默认不支持主题切换;如需支持,请使用fwColor相关方法Declaration
Objective-C
@interface FWThemeManager : NSObject
-
主题动态对象,可获取当前主题静态对象
See moreDeclaration
Objective-C
@interface FWThemeObject<__covariant ObjectType> : NSObject
-
权限管理器。由于打包上传ipa时会自动检查隐私库并提供Info.plist描述,所以默认关闭隐私库声明
开启指定权限方法: 一、Pod项目:添加pod时同时指定 pod ‘FWFramework’, :subspecs => [‘Contacts’] 二、SPM项目:添加依赖时选中target FWFrameworkContacts
See moreDeclaration
Swift
@objcMembers public class FWAuthorizeManager : NSObject
-
Keychain管理器
See moreDeclaration
Swift
@objcMembers public class FWKeychainManager : NSObject
-
通知管理器
See moreDeclaration
Swift
@objcMembers public class FWNotificationManager : NSObject, UNUserNotificationCenterDelegate
-
版本管理器
See moreDeclaration
Swift
@objcMembers public class FWVersionManager : NSObject
-
视图链式布局类。如果约束条件完全相同,会自动更新约束而不是重新添加。 另外,默认布局方式使用LTR,如果需要RTL布局,可通过fwAutoLayoutRTL统一启用
See moreDeclaration
Swift
public class FWLayoutChain