FWObjectWrapper
@interface FWObjectWrapper : 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];
-
原始对象
Declaration
Objective-C
@property (nonatomic, strong, readonly) id _Nonnull base;
-
Unavailable
禁用属性
Declaration
Objective-C
@property (nonatomic, strong, readonly) NS_UNAVAILABLE FWObjectWrapper *fw;
-
获取关联的类包装器类
Declaration
Objective-C
@property (nonatomic, readonly) Class _Nonnull wrapperClass;
-
创建包装器
Declaration
Objective-C
- (nonnull instancetype)init:(nonnull id)base;
-
从 appearance 里取值并赋值给当前实例,通常在对象的 init 里调用
Declaration
Objective-C
- (void)applyAppearance;
-
获取当前对象的所有 @property、方法,父类的方法也会分别列出
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull methodList;
-
获取当前对象的所有 @property、方法,不包含父类的
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull shortMethodList;
-
当前对象的所有 Ivar 变量
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull ivarList;
-
是否是非Null(nil, NSNull)
Declaration
Objective-C
@property (nonatomic, readonly) BOOL isNotNull;
Return Value
如果为非Null返回YES,为Null返回NO
-
是否是非空对象(nil, NSNull, count为0, length为0)
Declaration
Objective-C
@property (nonatomic, readonly) BOOL isNotEmpty;
Return Value
如果是非空对象返回YES,为空对象返回NO
-
检测并安全转换为NSInteger
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger safeInteger;
Return Value
NSInteger
-
检测并安全转换为Float
Declaration
Objective-C
@property (nonatomic, readonly) float safeFloat;
Return Value
Float
-
检测并安全转换为Double
Declaration
Objective-C
@property (nonatomic, readonly) double safeDouble;
Return Value
Double
-
检测并安全转换为Bool
Declaration
Objective-C
@property (nonatomic, readonly) BOOL safeBool;
Return Value
Bool
-
检测并安全转换为NSNumber
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSNumber *_Nonnull safeNumber;
Return Value
NSNumber
-
检测并安全转换为NSString
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull safeString;
Return Value
NSString
-
检测并安全转换为NSDate
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSDate *_Nonnull safeDate;
Return Value
NSDate
-
检测并安全转换为NSData
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSData *_Nonnull safeData;
Return Value
NSData
-
检测并安全转换为NSArray
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSArray *_Nonnull safeArray;
Return Value
NSArray
-
检测并安全转换为NSMutableArray
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSMutableArray *_Nonnull safeMutableArray;
Return Value
NSMutableArray
-
检测并安全转换为NSDictionary
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSDictionary *_Nonnull safeDictionary;
Return Value
NSDictionary
-
检测并安全转换为NSMutableDictionary
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSMutableDictionary *_Nonnull safeMutableDictionary;
Return Value
NSMutableDictionary
-
执行加锁(支持任意对象),等待信号量,自动创建信号量
Declaration
Objective-C
- (void)lock;
-
执行解锁(支持任意对象),发送信号量,自动创建信号量
Declaration
Objective-C
- (void)unlock;
-
监听某个点对点消息,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *) observeMessage:(nonnull NSNotificationName)name block:(nonnull void (^)(NSNotification *_Nonnull __strong))block;
Parameters
name
消息名称
block
消息句柄
Return Value
监听唯一标志
-
监听某个指定对象点对点消息,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *) observeMessage:(nonnull NSNotificationName)name object:(nullable id)object block:(nonnull void (^)(NSNotification *_Nonnull __strong))block;
Parameters
name
消息名称
object
消息对象,值为nil时表示所有
block
消息句柄
Return Value
监听唯一标志
-
监听某个点对点消息,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *)observeMessage:(nonnull NSNotificationName)name target:(nonnull id)target action:(nonnull SEL)action;
Parameters
name
消息名称
target
消息目标
action
目标动作,参数为通知对象
Return Value
监听唯一标志
-
监听某个指定对象点对点消息,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *)observeMessage:(nonnull NSNotificationName)name object:(nullable id)object target:(nonnull id)target action:(nonnull SEL)action;
Parameters
name
消息名称
object
消息对象,值为nil时表示所有
target
消息目标
action
目标动作,参数为通知对象
Return Value
监听唯一标志
-
手工移除某个点对点消息指定监听
Declaration
Objective-C
- (void)unobserveMessage:(nonnull NSNotificationName)name target:(nullable id)target action:(nullable SEL)action;
Parameters
name
消息名称
target
消息目标
action
目标动作
-
手工移除某个指定对象点对点消息指定监听
Declaration
Objective-C
- (void)unobserveMessage:(nonnull NSNotificationName)name object:(nullable id)object target:(nullable id)target action:(nullable SEL)action;
Parameters
name
消息名称
object
消息对象,值为nil时表示所有
target
消息目标
action
目标动作
-
手工移除某个指定对象点对点消息指定监听
Declaration
Objective-C
- (void)unobserveMessage:(nonnull NSNotificationName)name identifier:(nullable NSString *)identifier;
Parameters
name
消息名称
identifier
监听唯一标志
-
手工移除某个点对点消息所有监听
Declaration
Objective-C
- (void)unobserveMessage:(nonnull NSNotificationName)name;
Parameters
name
消息名称
-
手工移除某个指定对象点对点消息所有监听
Declaration
Objective-C
- (void)unobserveMessage:(nonnull NSNotificationName)name object:(nullable id)object;
Parameters
name
消息名称
object
消息对象,值为nil时表示所有
-
手工移除所有点对点消息监听
Declaration
Objective-C
- (void)unobserveAllMessages;
-
发送点对点消息
Declaration
Objective-C
- (void)sendMessage:(nonnull NSNotificationName)name toReceiver:(nonnull id)receiver;
Parameters
name
消息名称
receiver
消息接收者
-
发送点对点消息,附带对象
Declaration
Objective-C
- (void)sendMessage:(nonnull NSNotificationName)name object:(nullable id)object toReceiver:(nonnull id)receiver;
Parameters
name
消息名称
object
消息对象
receiver
消息接收者
-
发送点对点消息,附带对象和用户信息
Declaration
Objective-C
- (void)sendMessage:(nonnull NSNotificationName)name object:(nullable id)object userInfo:(nullable NSDictionary *)userInfo toReceiver:(nonnull id)receiver;
Parameters
name
消息名称
object
消息对象
userInfo
用户信息
receiver
消息接收者
-
监听某个广播通知,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *) observeNotification:(nonnull NSNotificationName)name block:(nonnull void (^)(NSNotification *_Nonnull __strong)) block;
Parameters
name
通知名称
block
通知句柄
Return Value
监听唯一标志
-
监听某个指定对象广播通知,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *) observeNotification:(nonnull NSNotificationName)name object:(nullable id)object block:(nonnull void (^)(NSNotification *_Nonnull __strong)) block;
Parameters
name
通知名称
object
通知对象,值为nil时表示所有
block
通知句柄
Return Value
监听唯一标志
-
监听某个广播通知,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *)observeNotification:(nonnull NSNotificationName)name target:(nonnull id)target action:(nonnull SEL)action;
Parameters
name
通知名称
target
通知目标
action
目标动作,参数为通知对象
Return Value
监听唯一标志
-
监听某个指定对象广播通知,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *)observeNotification:(nonnull NSNotificationName)name object:(nullable id)object target:(nonnull id)target action:(nonnull SEL)action;
Parameters
name
通知名称
object
通知对象,值为nil时表示所有
target
通知目标
action
目标动作,参数为通知对象
Return Value
监听唯一标志
-
手工移除某个广播通知指定监听
Declaration
Objective-C
- (void)unobserveNotification:(nonnull NSNotificationName)name target:(nullable id)target action:(nullable SEL)action;
Parameters
name
通知名称
target
通知目标
action
目标动作
-
手工移除某个指定对象广播通知指定监听
Declaration
Objective-C
- (void)unobserveNotification:(nonnull NSNotificationName)name object:(nullable id)object target:(nullable id)target action:(nullable SEL)action;
Parameters
name
通知名称
object
通知对象,值为nil时表示所有
target
通知目标
action
目标动作
-
手工移除某个指定对象广播通知指定监听
Declaration
Objective-C
- (void)unobserveNotification:(nonnull NSNotificationName)name identifier:(nullable NSString *)identifier;
Parameters
name
通知名称
identifier
监听唯一标志
-
手工移除某个广播通知所有监听
Declaration
Objective-C
- (void)unobserveNotification:(nonnull NSNotificationName)name;
Parameters
name
通知名称
-
手工移除某个指定对象广播通知所有监听
Declaration
Objective-C
- (void)unobserveNotification:(nonnull NSNotificationName)name object:(nullable id)object;
Parameters
name
通知名称
object
通知对象,值为nil时表示所有
-
手工移除所有广播通知监听
Declaration
Objective-C
- (void)unobserveAllNotifications;
-
发送广播通知
Declaration
Objective-C
- (void)postNotification:(nonnull NSNotificationName)name;
Parameters
name
通知名称
-
发送广播通知,附带对象
Declaration
Objective-C
- (void)postNotification:(nonnull NSNotificationName)name object:(nullable id)object;
Parameters
name
通知名称
object
通知对象
-
发送广播通知,附带对象和用户信息
Declaration
Objective-C
- (void)postNotification:(nonnull NSNotificationName)name object:(nullable id)object userInfo:(nullable NSDictionary *)userInfo;
Parameters
name
通知名称
object
通知对象
userInfo
用户信息
-
监听对象某个属性,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *) observeProperty:(nonnull NSString *)property block:(nonnull void (^)(id _Nonnull __strong, NSDictionary *_Nonnull __strong))block;
Parameters
property
属性名称
block
目标句柄,block参数依次为object、优化的change字典(不含NSNull)
Return Value
监听唯一标志
-
监听对象某个属性,对象释放时自动移除监听,添加多次执行多次
Declaration
Objective-C
- (nullable NSString *)observeProperty:(nonnull NSString *)property target:(nonnull id)target action:(nonnull SEL)action;
Parameters
property
属性名称
target
目标对象
action
目标动作,action参数依次为object、优化的change字典(不含NSNull)
Return Value
监听唯一标志
-
手工移除某个属性指定监听
Declaration
Objective-C
- (void)unobserveProperty:(nonnull NSString *)property target:(nullable id)target action:(nullable SEL)action;
Parameters
property
属性名称
target
目标对象,值为nil时移除所有对象(同UIControl)
action
目标动作,值为nil时移除所有动作(同UIControl)
-
手工移除某个属性指定监听
Declaration
Objective-C
- (void)unobserveProperty:(nonnull NSString *)property identifier:(nullable NSString *)identifier;
Parameters
property
属性名称
identifier
监听唯一标志
-
手工移除某个属性所有监听
Declaration
Objective-C
- (void)unobserveProperty:(nonnull NSString *)property;
Parameters
property
属性名称
-
手工移除所有属性所有监听
Declaration
Objective-C
- (void)unobserveAllProperties;
-
使用swizzle替换对象实例方法为block实现,identifier相同时仅执行一次。结合fwIsSwizzleMethod使用
Declaration
Objective-C
- (BOOL)swizzleInstanceMethod:(nonnull SEL)originalSelector identifier:(nonnull NSString *)identifier withBlock: (nonnull id _Nonnull (^)( __unsafe_unretained Class _Nonnull, SEL _Nonnull, IMP _Nonnull (^_Nonnull __strong)(void)))block;
Parameters
originalSelector
原始方法
identifier
唯一标识
block
实现句柄
Return Value
是否成功
-
判断对象是否使用swizzle替换过指定identifier实例方法。结合fwSwizzleMethod使用
Note
因为实际替换的是类方法,为了防止影响该类其它对象,需先判断该对象是否替换过,仅替换过才执行自定义流程
Declaration
Objective-C
- (BOOL)isSwizzleInstanceMethod:(nonnull SEL)originalSelector identifier:(nonnull NSString *)identifier;
Parameters
originalSelector
原始方法
identifier
唯一标识
Return Value
是否替换
-
安全调用方法,如果不能响应,则忽略之
Declaration
Objective-C
- (nullable id)invokeMethod:(nonnull SEL)aSelector;
Parameters
aSelector
要执行的方法
Return Value
id 方法执行后返回的值。如果无返回值,则为nil
-
安全调用方法,如果不能响应,则忽略之
Declaration
Objective-C
- (nullable id)invokeMethod:(nonnull SEL)aSelector withObject:(nullable id)object;
Parameters
aSelector
要执行的方法
object
传递的方法参数,非id类型可使用桥接,如int a = 1;(__bridge id)(void *)a
Return Value
id 方法执行后返回的值。如果无返回值,则为nil
-
对super发送消息
Declaration
Objective-C
- (nullable id)invokeSuperMethod:(nonnull SEL)aSelector;
Parameters
aSelector
要执行的方法,需返回id类型
Return Value
id 方法执行后返回的值
-
对super发送消息,可传递参数
Declaration
Objective-C
- (nullable id)invokeSuperMethod:(nonnull SEL)aSelector withObject:(nullable id)object;
Parameters
aSelector
要执行的方法,需返回id类型
object
传递的方法参数
Return Value
id 方法执行后返回的值
-
安全调用内部属性获取方法,如果属性不存在,则忽略之
Note
如果iOS13系统UIView调用部分valueForKey:方法闪退,且没有好的替代方案,可尝试调用此方法
Declaration
Objective-C
- (nullable id)invokeGetter:(nonnull NSString *)name;
Parameters
name
内部属性名称
Return Value
属性值
-
安全调用内部属性设置方法,如果属性不存在,则忽略之
Note
如果iOS13系统UIView调用部分valueForKey:方法闪退,且没有好的替代方案,可尝试调用此方法
Declaration
Objective-C
- (nullable id)invokeSetter:(nonnull NSString *)name withObject:(nullable id)object;
Parameters
name
内部属性名称
object
传递的方法参数
Return Value
方法执行后返回的值
-
临时对象,强引用,支持KVO
Note
备注:key的几种形式的声明和使用,下同- 声明:static char kAssociatedObjectKey; 使用:&kAssociatedObjectKey
- 声明:static void *kAssociatedObjectKey = &kAssociatedObjectKey; 使用:kAssociatedObjectKey
- 声明和使用直接用getter方法的selector,如@selector(xxx)、_cmd
- 声明和使用直接用c字符串,如"kAssociatedObjectKey"
Declaration
Objective-C
@property (nonatomic, strong, nullable) id tempObject;
-
读取关联属性
Declaration
Objective-C
- (nullable id)propertyForName:(nonnull NSString *)name;
Parameters
name
属性名称
Return Value
属性值
-
设置强关联属性,支持KVO
Declaration
Objective-C
- (void)setProperty:(nullable id)object forName:(nonnull NSString *)name;
Parameters
object
属性值
name
属性名称
-
设置赋值关联属性,支持KVO,注意可能会产生野指针
Declaration
Objective-C
- (void)setPropertyAssign:(nullable id)object forName:(nonnull NSString *)name;
Parameters
object
属性值
name
属性名称
-
设置拷贝关联属性,支持KVO
Declaration
Objective-C
- (void)setPropertyCopy:(nullable id)object forName:(nonnull NSString *)name;
Parameters
object
属性值
name
属性名称
-
设置弱引用关联属性,支持KVO,OC不支持weak关联属性
Declaration
Objective-C
- (void)setPropertyWeak:(nullable id)object forName:(nonnull NSString *)name;
Parameters
object
属性值
name
属性名称
-
给对象绑定上另一个对象以供后续取出使用,如果 object 传入 nil 则会清除该 key 之前绑定的对象
Declaration
Objective-C
- (void)bindObject:(nullable id)object forKey:(nonnull NSString *)key;
Parameters
object
对象,会被 strong 强引用
key
键名
-
给对象绑定上另一个弱引用对象以供后续取出使用,如果 object 传入 nil 则会清除该 key 之前绑定的对象
Declaration
Objective-C
- (void)bindObjectWeak:(nullable id)object forKey:(nonnull NSString *)key;
Parameters
object
对象,不会被 strong 强引用
key
键名
-
取出之前使用 bind 方法绑定的对象
Declaration
Objective-C
- (nullable id)boundObjectForKey:(nonnull NSString *)key;
Parameters
key
键名
-
给对象绑定上一个 double 值以供后续取出使用
Declaration
Objective-C
- (void)bindDouble:(double)doubleValue forKey:(nonnull NSString *)key;
Parameters
doubleValue
double值
key
键名
-
取出之前用 bindDouble:forKey: 绑定的值
Declaration
Objective-C
- (double)boundDoubleForKey:(nonnull NSString *)key;
Parameters
key
键名
-
给对象绑定上一个 BOOL 值以供后续取出使用
Declaration
Objective-C
- (void)bindBool:(BOOL)boolValue forKey:(nonnull NSString *)key;
Parameters
boolValue
布尔值
key
键名
-
取出之前用 bindBool:forKey: 绑定的值
Declaration
Objective-C
- (BOOL)boundBoolForKey:(nonnull NSString *)key;
Parameters
key
键名
-
给对象绑定上一个 NSInteger 值以供后续取出使用
Declaration
Objective-C
- (void)bindInt:(NSInteger)integerValue forKey:(nonnull NSString *)key;
Parameters
integerValue
整数值
key
键名
-
取出之前用 bindInt:forKey: 绑定的值
Declaration
Objective-C
- (NSInteger)boundIntForKey:(nonnull NSString *)key;
Parameters
key
键名
-
移除之前使用 bind 方法绑定的对象
Declaration
Objective-C
- (void)removeBindingForKey:(nonnull NSString *)key;
Parameters
key
键名
-
移除之前使用 bind 方法绑定的所有对象
Declaration
Objective-C
- (void)removeAllBindings;
-
返回当前有绑定对象存在的所有的 key 的数组,数组中元素的顺序是随机的,如果不存在任何 key,则返回一个空数组
Declaration
Objective-C
- (nonnull NSArray<NSString *> *)allBindingKeys;
-
返回是否设置了某个 key
Declaration
Objective-C
- (BOOL)hasBindingKey:(nonnull NSString *)key;
Parameters
key
键名
-
订阅主题通知并指定主题上下文(如vc|view),非UITraitEnvironment等需指定后才能响应系统主题
Declaration
Objective-C
@property (nonatomic, weak, nullable) id<UITraitEnvironment> themeContext;
-
添加iOS13主题改变通知回调,返回订阅唯一标志,需订阅后才生效
Declaration
Objective-C
- (nullable NSString *)addThemeListener: (nonnull void (^)(FWThemeStyle))listener;
-
iOS13根据订阅唯一标志移除主题通知回调
Declaration
Objective-C
- (void)removeThemeListener:(nullable NSString *)identifier;
-
iOS13移除所有主题通知回调,一般用于cell重用
Declaration
Objective-C
- (void)removeAllThemeListeners;
-
iOS13主题改变包装器钩子,如果父类有重写,记得调用super,需订阅后才生效
Declaration
Objective-C
- (void)themeChanged:(FWThemeStyle)style;
-
从json对象设置对象属性
Declaration
Objective-C
- (BOOL)modelSetWithJson:(nonnull id)json;
Parameters
json
json对象,支持NSDictionary、NSString、NSData
Return Value
是否设置成功
-
从字典设置对象属性
Declaration
Objective-C
- (BOOL)modelSetWithDictionary:(nonnull NSDictionary *)dictionary;
Parameters
dictionary
字典数据
Return Value
是否设置成功
-
转换为json对象
Declaration
Objective-C
- (nullable id)modelToJsonObject;
Return Value
json对象,如NSDictionary、NSArray,失败为nil
-
转换为json字符串数据
Declaration
Objective-C
- (nullable NSData *)modelToJsonData;
Return Value
NSData,失败为nil
-
转换为json字符串
Declaration
Objective-C
- (nullable NSString *)modelToJsonString;
Return Value
NSString,失败为nil
-
从属性拷贝当前对象
Declaration
Objective-C
- (nullable id)modelCopy;
Return Value
拷贝对象,失败为nil
-
对象编码
Declaration
Objective-C
- (void)modelEncodeWithCoder:(nonnull NSCoder *)aCoder;
-
对象解码
Declaration
Objective-C
- (nonnull id)modelInitWithCoder:(nonnull NSCoder *)aDecoder;
-
对象的hash编码
Declaration
Objective-C
- (NSUInteger)modelHash;
-
比较Model
Declaration
Objective-C
- (BOOL)modelIsEqual:(nonnull id)model;
-
对象描述
Declaration
Objective-C
- (nonnull NSString *)modelDescription;
-
使用NSKeyedArchiver和NSKeyedUnarchiver深拷对象
Declaration
Objective-C
- (nullable id)archiveCopy;
Return Value
出错返回nil
-
延迟delay秒后主线程执行,返回可取消的block,对象范围
Declaration
Objective-C
- (nonnull id)performBlock:(nonnull void (^)(id _Nonnull __strong))block afterDelay:(NSTimeInterval)delay;
-
延迟delay秒后后台线程执行,返回可取消的block,对象范围
Declaration
Objective-C
- (nonnull id)performBlockInBackground: (nonnull void (^)(id _Nonnull __strong))block afterDelay:(NSTimeInterval)delay;
-
延迟delay秒后指定线程执行,返回可取消的block,对象范围
Declaration
Objective-C
- (nonnull id)performBlock:(nonnull void (^)(id _Nonnull __strong))block onQueue:(nonnull dispatch_queue_t)queue afterDelay:(NSTimeInterval)delay;
-
同步方式执行异步block,阻塞当前线程(信号量),异步block必须调用completionHandler,全局范围
Declaration
Objective-C
- (void)syncPerformAsyncBlock: (nonnull void (^)(void (^_Nonnull __strong)(void)))asyncBlock;
-
同一个identifier仅执行一次block,对象范围
Declaration
Objective-C
- (void)performOnce:(nonnull NSString *)identifier withBlock:(nonnull void (^)(void))block;
-
重试方式执行异步block,直至成功或者次数为0或者超时,完成后回调completion。block必须调用completionHandler,参数示例:重试4次|超时8秒|延迟2秒
Declaration
Objective-C
- (void)performBlock:(nonnull void (^)(void (^_Nonnull __strong)( BOOL, id _Nullable __strong)))block completion:(nonnull void (^)(BOOL, id _Nullable __strong))completion retryCount:(NSUInteger)retryCount timeoutInterval:(NSTimeInterval)timeoutInterval delayInterval:(NSTimeInterval)delayInterval;
-
显示骨架屏,指定布局代理
Declaration
Swift
open func showSkeleton(delegate: FWSkeletonViewDelegate? = nil)
-
显示骨架屏,指定布局句柄
Declaration
Swift
open func showSkeleton(block: ((FWSkeletonLayout) -> Void)? = nil)
-
显示骨架屏,默认布局代理为self
Declaration
Swift
open func showSkeleton()
-
隐藏骨架屏
Declaration
Swift
open func hideSkeleton()
-
是否正在显示骨架屏
Declaration
Swift
open var hasSkeleton: Bool { get }
-
显示view骨架屏,指定布局代理
Declaration
Swift
open func showSkeleton(delegate: FWSkeletonViewDelegate? = nil)
-
显示view骨架屏,指定布局句柄
Declaration
Swift
open func showSkeleton(block: ((FWSkeletonLayout) -> Void)? = nil)
-
显示view骨架屏,默认布局代理为self
Declaration
Swift
open func showSkeleton()
-
隐藏view骨架屏
Declaration
Swift
open func hideSkeleton()
-
是否正在显示view骨架屏
Declaration
Swift
open var hasSkeleton: Bool { get }
-
Undocumented
Declaration
Swift
var delegate: FWCollectionViewDelegate { get }
-
Undocumented
Declaration
Swift
var delegate: FWTableViewDelegate { get }