File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
GoogleUtilities/SecureCoding Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,12 @@ + (nullable id)unarchivedObjectOfClass:(Class)class
22
22
fromData : (NSData *)data
23
23
error : (NSError **)outError {
24
24
id object;
25
+ #if __has_builtin(__builtin_available)
25
26
if (@available (macOS 10.13 , iOS 11.0 , tvOS 11.0 , *)) {
26
27
object = [NSKeyedUnarchiver unarchivedObjectOfClass: class fromData: data error: outError];
27
- } else {
28
+ } else
29
+ #endif // __has_builtin(__builtin_available)
30
+ {
28
31
@try {
29
32
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc ] initForReadingWithData: data];
30
33
unarchiver.requiresSecureCoding = YES ;
@@ -49,11 +52,14 @@ + (nullable id)unarchivedObjectOfClass:(Class)class
49
52
50
53
+ (nullable NSData *)archivedDataWithRootObject : (id <NSCoding >)object error : (NSError **)outError {
51
54
NSData *archiveData;
55
+ #if __has_builtin(__builtin_available)
52
56
if (@available (macOS 10.13 , iOS 11.0 , tvOS 11.0 , *)) {
53
57
archiveData = [NSKeyedArchiver archivedDataWithRootObject: object
54
58
requiringSecureCoding: YES
55
59
error: outError];
56
- } else {
60
+ } else
61
+ #endif // __has_builtin(__builtin_available)
62
+ {
57
63
@try {
58
64
NSMutableData *data = [NSMutableData data ];
59
65
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc ] initForWritingWithMutableData: data];
You can’t perform that action at this time.
0 commit comments