NSObject(FWSafeType)
@interface NSObject (FWSafeType)
/**
是否是非Null(nil, NSNull)
@return 如果为非Null返回YES,为Null返回NO
*/
@property (nonatomic, assign, readonly) BOOL fw_isNotNull NS_REFINED_FOR_SWIFT;
/**
是否是非空对象(nil, NSNull, count为0, length为0)
@return 如果是非空对象返回YES,为空对象返回NO
*/
@property (nonatomic, assign, readonly) BOOL fw_isNotEmpty NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为NSInteger
@return NSInteger
*/
@property (nonatomic, assign, readonly) NSInteger fw_safeInteger NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为Float
@return Float
*/
@property (nonatomic, assign, readonly) float fw_safeFloat NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为Double
@return Double
*/
@property (nonatomic, assign, readonly) double fw_safeDouble NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为Bool
@return Bool
*/
@property (nonatomic, assign, readonly) BOOL fw_safeBool NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为NSNumber
@return NSNumber
*/
@property (nonatomic, strong, readonly) NSNumber *fw_safeNumber NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为NSString
@return NSString
*/
@property (nonatomic, copy, readonly) NSString *fw_safeString NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为NSDate
@return NSDate
*/
@property (nonatomic, strong, readonly) NSDate *fw_safeDate NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为NSData
@return NSData
*/
@property (nonatomic, strong, readonly) NSData *fw_safeData NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为NSArray
@return NSArray
*/
@property (nonatomic, strong, readonly) NSArray *fw_safeArray NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为NSMutableArray
@return NSMutableArray
*/
@property (nonatomic, strong, readonly) NSMutableArray *fw_safeMutableArray NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为NSDictionary
@return NSDictionary
*/
@property (nonatomic, strong, readonly) NSDictionary *fw_safeDictionary NS_REFINED_FOR_SWIFT;
/**
检测并安全转换为NSMutableDictionary
@return NSMutableDictionary
*/
@property (nonatomic, strong, readonly) NSMutableDictionary *fw_safeMutableDictionary NS_REFINED_FOR_SWIFT;
@end
Undocumented
-
是否是非Null(nil, NSNull)
Declaration
Objective-C
@property (nonatomic, readonly) BOOL fw_isNotNull;
Return Value
如果为非Null返回YES,为Null返回NO
-
是否是非空对象(nil, NSNull, count为0, length为0)
Declaration
Objective-C
@property (nonatomic, readonly) BOOL fw_isNotEmpty;
Return Value
如果是非空对象返回YES,为空对象返回NO
-
检测并安全转换为NSInteger
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger fw_safeInteger;
Return Value
NSInteger
-
检测并安全转换为Float
Declaration
Objective-C
@property (nonatomic, readonly) float fw_safeFloat;
Return Value
Float
-
检测并安全转换为Double
Declaration
Objective-C
@property (nonatomic, readonly) double fw_safeDouble;
Return Value
Double
-
检测并安全转换为Bool
Declaration
Objective-C
@property (nonatomic, readonly) BOOL fw_safeBool;
Return Value
Bool
-
检测并安全转换为NSNumber
Declaration
Objective-C
@property (nonatomic, strong, readonly) NS_REFINED_FOR_SWIFT NSNumber *fw_safeNumber;
Return Value
NSNumber
-
检测并安全转换为NSString
Declaration
Objective-C
@property (nonatomic, copy, readonly) NS_REFINED_FOR_SWIFT NSString *fw_safeString;
Return Value
NSString
-
检测并安全转换为NSDate
Declaration
Objective-C
@property (nonatomic, strong, readonly) NS_REFINED_FOR_SWIFT NSDate *fw_safeDate;
Return Value
NSDate
-
检测并安全转换为NSData
Declaration
Objective-C
@property (nonatomic, strong, readonly) NS_REFINED_FOR_SWIFT NSData *fw_safeData;
Return Value
NSData
-
检测并安全转换为NSArray
Declaration
Objective-C
@property (nonatomic, strong, readonly) NS_REFINED_FOR_SWIFT NSArray *fw_safeArray;
Return Value
NSArray
-
检测并安全转换为NSMutableArray
Declaration
Objective-C
@property (nonatomic, strong, readonly) NS_REFINED_FOR_SWIFT NSMutableArray *fw_safeMutableArray;
Return Value
NSMutableArray
-
检测并安全转换为NSDictionary
Declaration
Objective-C
@property (nonatomic, strong, readonly) NS_REFINED_FOR_SWIFT NSDictionary *fw_safeDictionary;
Return Value
NSDictionary
-
检测并安全转换为NSMutableDictionary
Declaration
Objective-C
@property (nonatomic, strong, readonly) NS_REFINED_FOR_SWIFT NSMutableDictionary *fw_safeMutableDictionary;
Return Value
NSMutableDictionary