//設(shè)置屬性不可為空,如果仍然想可為空,可以單獨設(shè)置該屬性
NS_ASSUME_NONNULL_BEGIN
@protocol XXXDelegate <NSObject, UIScrollViewDelegate>
@end
//
@interface XXX : UIScrollView
@property (nullable, nonatomic,,strong) __kindof UIView *inputAccessoryView;
@end
NS_ASSUME_NONNULL_END
nullable
@property (nullable, nonatomic,,strong) __kindof UIView *inputAccessoryView;
nullable : 可以為空
nonnull
@property (nonnull, nonatomic, strong) UIView *inputAccessoryView;
nonnull : 修飾指針對象,不可以為空
null_resettableget
@property (null_resettable, nonatomic, copy) NSString *text;
null_resettableget : 不能返回空, set可以為空(注意:如果使用null_resettable,必須 重寫get方法或者set方法,處理傳遞的值為空的情況)
_Null_unspecified
_Null_unspecified : 不確定是否為空
__kindof
@property (nullable, nonatomic, strong) __kindof UIView *inputView;
__kindof : 設(shè)置inputView可以UIView或者UIView的子類
__typeof
__typeof :(對應(yīng)__kindof)返回制定類型
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。