| @_exported import MapKit // Clang module |
| import Foundation |
| |
| %{ |
| from gyb_foundation_support import \ |
| ObjectiveCBridgeableImplementationForNSValueWithCategoryMethods |
| }% |
| |
| // Get the ObjC type used by -[NSValue valueWithMKCoordinateSpan:] |
| // to instantiate the resulting NSValue objects, in case these get changed |
| // in the future. |
| @available(tvOS 9.2, *) |
| private let MKCoordinateSpanInNSValueObjCType = |
| NSValue(mkCoordinateSpan: .init()).objCType |
| |
| ${ ObjectiveCBridgeableImplementationForNSValueWithCategoryMethods( |
| Type="MKCoordinateSpan", |
| initializer="""{ |
| guard #available(tvOS 9.2, *) else { |
| fatalError("MKCoordinateSpan is not supported on tvOS before tvOS 9.2") |
| } |
| return NSValue(mkCoordinateSpan: $0) |
| }""", |
| getter="""{ |
| guard #available(tvOS 9.2, *) else { |
| fatalError("MKCoordinateSpan is not supported on tvOS before tvOS 9.2") |
| } |
| return $0.mkCoordinateSpanValue |
| }""", |
| objCType="""{ _ in |
| guard #available(tvOS 9.2, *) else { |
| fatalError("MKCoordinateSpan is not supported on tvOS before tvOS 9.2") |
| } |
| return MKCoordinateSpanInNSValueObjCType |
| }""", |
| ) } |