NSSecureCoding // Objects which are safe to be encoded and decoded across privilege boundaries should adopt NSSecureCoding instead of NSCoding. protocol. // NOTE: NSSecureCoding guarantees only that an archive contains the classes it claims. @protocol NSSecureCoding <NSCoding> @required // This property must return YES on all classes that allow 大部分支持NSCoding的系统对象都已经升级到支持NSSecureCoding; 常用于对象编解码; 致谢 感谢雨雪传奇的作品 感谢黄龙辉的作品
@protocol AFURLRequestSerialization <NSObject, NSSecureCoding, NSCopying> @interface AFHTTPRequestSerializer ` HTTP header field value to `application/json`. */ @protocol AFURLRequestSerialization <NSObject, NSSecureCoding
三、数据模型类 首先,CoreMotion框架中的数据模型类都继承自CMLogItem类,这个类里面只有一个属性: @interface CMLogItem : NSObject <NSSecureCoding CMMagneticFieldCalibrationAccuracyHigh//高 } ; CMAttitude类中封装的信息如下: @interface CMAttitude : NSObject <NSCopying, NSSecureCoding @end CMDyskineticSymptomResult运动障碍数据模型: @interface CMDyskineticSymptomResult : NSObject <NSCopying, NSSecureCoding float percentLikely; @end CMTremorResult记录用户震颤数据: @interface CMTremorResult : NSObject <NSCopying, NSSecureCoding stopPedometerEventUpdates; @end CMPedometerEvent类记录计步器的事件变化: @interface CMPedometerEvent : NSObject <NSSecureCoding
这个类的核心方法只有一个init方法,通过一个类型字符串进行创建,字符串用于在回调中区分 @interface CSSearchableItemAttributeSet : NSObject <NSCopying,NSSecureCoding 主要内容如下: //这个类主要用于创建搜索的标签 @interface CSSearchableItem : NSObject <NSSecureCoding, NSCopying> //init方法
systemName: "folder.badge.person.crop") 我们看看这个 systemName 的初始化函数的整体情况: open class UIImage : NSObject, NSSecureCoding
看一下NSArray对泛型的定义: @interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding NSDictionary<__covariant KeyType, __covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding
@protocol AFURLResponseSerialization <NSObject, NSSecureCoding, NSCopying> @interface AFHTTPResponseSerializer
三、AFHTTPSessionManager @interface AFHTTPSessionManager : AFURLSessionManager <NSSecureCoding, NSCopying NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NSSecureCoding
CALayer @interface CALayer : NSObject <NSSecureCoding, CAMediaTiming> 直接继承自NSObject,所以不能响应事件 其实就是一个图层
AFURLRequestSerialization协议,继承自<NSObject, NSSecureCoding, NSCopying>三个协议。 其中NSSecureCoding协议,主要用于在解码时要同时指定key和要解码的对象的类,如果要求的类和从文件中解码出的对象的类不匹配,NSCoder则会抛出异常并通知数据已经被篡改。
AFHTTPSessionManager.h @interface AFHTTPSessionManager : AFURLSessionManager <NSSecureCoding, NSCopying NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NSSecureCoding
存储的数据需要继承自NSObject并遵循NSSecureCoding协议。 案例 自定义对象 class Person: NSObject, NSSecureCoding { var name:String? var age:Int?
JJKeychain : NSObject //保存是先删掉之前的key,没有使用update,感觉这样简单;然后保存的value转换为NSData,如果value为自定义object,则需遵循NSSecureCoding
interface JJKeychain : NSObject //保存是先删掉之前的key,没有使用update,感觉这样简单;然后保存的value转换为NSData,如果value为自定义object,则需遵循NSSecureCoding
UIApplicationShortcutIcon *icon; @property (nullable, nonatomic, copy, readonly) NSDictionary<NSString *, id <NSSecureCoding UIApplicationShortcutIcon *icon; @property (nullable, nonatomic, copy) NSDictionary<NSString *, id <NSSecureCoding
interface AFURLConnectionOperation : NSOperation <NSURLConnectionDelegate, NSURLConnectionDataDelegate, NSSecureCoding
interface AFURLConnectionOperation : NSOperation <NSURLConnectionDelegate, NSURLConnectionDataDelegate, NSSecureCoding
详解 它的父类为NSObject @interface SCNCamera : NSObject <SCNAnimatable, SCNTechniqueSupport, NSCopying, NSSecureCoding
AFURLSessionManager,它主要封装了GET,POST,PUT,DELETE等等HTTPMehtod @interface AFHTTPSessionManager : AFURLSessionManager <NSSecureCoding NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NSSecureCoding 它是为了验证证书的,至于HTTP和HTTPS的区别,这个在百度上有很多文章,我这里主要看AFSecurityPolicy都有哪些功能 @interface AFSecurityPolicy : NSObject <NSSecureCoding
instancetype)attachmentWithString:(NSString *)string; + (instancetype)attachmentWithArchivableObject:(id<NSSecureCoding >)object; + (instancetype)attachmentWithArchivableObject:(id<NSSecureCoding>)object uniformTypeIdentifier