mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-06-28 04:46:27 +02:00
add conditional compilation
This commit is contained in:
@@ -115,7 +115,14 @@ extension NSManagedObject: DynamicObject {
|
|||||||
|
|
||||||
public class func cs_fromRaw(object: NSManagedObject) -> Self {
|
public class func cs_fromRaw(object: NSManagedObject) -> Self {
|
||||||
|
|
||||||
|
#if swift(>=5.9)
|
||||||
return unsafeDowncast(object, to: self)
|
return unsafeDowncast(object, to: self)
|
||||||
|
|
||||||
|
#else
|
||||||
|
// unsafeDowncast fails debug assertion starting Swift 5.2
|
||||||
|
return _unsafeUncheckedDowncast(object, to: self)
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func cs_matches(object: NSManagedObject) -> Bool {
|
public static func cs_matches(object: NSManagedObject) -> Bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user