swift 3.1 support

This commit is contained in:
John Estropia
2017-02-07 18:17:40 +09:00
parent 69d96c53d6
commit bdf6308d8f
29 changed files with 81 additions and 56 deletions

View File

@@ -68,28 +68,20 @@ public protocol CoreStoreSwiftType {
var bridgeToObjectiveC: ObjectiveCType { get }
}
public extension CoreStoreSwiftType where ObjectiveCType: CoreStoreObjectiveCType, Self == ObjectiveCType.SwiftType {
public var bridgeToObjectiveC: ObjectiveCType {
return ObjectiveCType(self)
}
}
// MARK: - Internal
internal func bridge<T: CoreStoreSwiftType>(_ closure: () -> T) -> T.ObjectiveCType where T.ObjectiveCType: CoreStoreObjectiveCType, T == T.ObjectiveCType.SwiftType {
internal func bridge<T: CoreStoreSwiftType>(_ closure: () -> T) -> T.ObjectiveCType {
return closure().bridgeToObjectiveC
}
internal func bridge<T: CoreStoreSwiftType>(_ closure: () -> T?) -> T.ObjectiveCType? where T.ObjectiveCType: CoreStoreObjectiveCType, T == T.ObjectiveCType.SwiftType {
internal func bridge<T: CoreStoreSwiftType>(_ closure: () -> T?) -> T.ObjectiveCType? {
return closure()?.bridgeToObjectiveC
}
internal func bridge<T: CoreStoreSwiftType>(_ closure: () throws -> T) throws -> T.ObjectiveCType where T.ObjectiveCType: CoreStoreObjectiveCType, T == T.ObjectiveCType.SwiftType {
internal func bridge<T: CoreStoreSwiftType>(_ closure: () throws -> T) throws -> T.ObjectiveCType {
do {