Cleanup unnecessary #available branches

This commit is contained in:
John Estropia
2021-03-07 12:01:08 +09:00
parent 0b127956d3
commit 003bf897e2
37 changed files with 65 additions and 415 deletions

View File

@@ -47,17 +47,10 @@ extension FieldCoders {
return nil
}
if #available(iOS 11.0, macOS 10.13, watchOS 4.0, tvOS 11.0, *) {
return try! NSKeyedArchiver.archivedData(
withRootObject: fieldValue,
requiringSecureCoding: self.requiresSecureCoding
)
}
else {
return NSKeyedArchiver.archivedData(withRootObject: fieldValue)
}
return try! NSKeyedArchiver.archivedData(
withRootObject: fieldValue,
requiringSecureCoding: self.requiresSecureCoding
)
}
public static func decodeFromStoredData(_ data: Data?) -> FieldStoredValue? {
@@ -66,14 +59,10 @@ extension FieldCoders {
return nil
}
if #available(iOS 11.0, macOS 10.13, watchOS 4.0, tvOS 11.0, *) {
return try! NSKeyedUnarchiver.unarchivedObject(ofClass: FieldStoredValue.self, from: data)
}
else {
return NSKeyedUnarchiver.unarchiveObject(with: data) as! FieldStoredValue?
}
return try! NSKeyedUnarchiver.unarchivedObject(
ofClass: FieldStoredValue.self,
from: data
)
}