@@ -20,13 +20,14 @@ For projection conversions between coordinates, see [Projections](https://ngageo
2020View the latest [ Appledoc] ( http://ngageoint.github.io/coordinate-reference-systems-ios/docs/api/ )
2121
2222``` objectivec
23+ @import CoordinateReferenceSystems;
2324
2425// NSString *wkt = ...
2526
2627CRSObject *crs = [CRSReader read: wkt] ;
2728
28- enum CRSType type = crs.type;
29- enum CRSCategoryType category = crs.categoryType;
29+ CRSType type = crs.type;
30+ CRSCategoryType category = crs.categoryType;
3031
3132NSString * text = [ CRSWriter write: crs ] ;
3233NSString * prettyText = [ CRSWriter writePretty: crs ] ;
@@ -164,45 +165,50 @@ NSString *projTextFromWKT = [CRSProjParser paramsTextFromText:wkt];
164165
165166### Build ###
166167
167- [ ![ Build & Test ] ( https://github.com/ngageoint/coordinate-reference-systems-ios/workflows/Build%20&%20Test /badge.svg )] ( https://github.com/ngageoint/coordinate-reference-systems-ios/actions/workflows/build-test .yml )
168+ [ ![ Build] ( https://github.com/ngageoint/coordinate-reference-systems-ios/actions/ workflows/build.yml /badge.svg )] ( https://github.com/ngageoint/coordinate-reference-systems-ios/actions/workflows/build.yml )
168169
169- Build this repository using Xcode and/or CocoaPods :
170+ Build this repository using Swift Package Manager :
170171
171- pod repo update
172- pod install
172+ swift build
173173
174- Open crs-ios.xcworkspace in Xcode or build from command line:
175-
176- xcodebuild -workspace 'crs-ios.xcworkspace' -scheme crs-ios build
177174
178175Run tests from Xcode or from command line:
179176
180- xcodebuild test -workspace 'crs-ios.xcworkspace' -scheme crs-ios -destination 'platform=iOS Simulator,name=iPhone 15'
177+ swift test
181178
182- ### Include Library ###
179+ Open the Swift Package in Xcode from command line:
183180
184- Include this repository by specifying it in a Podfile using a supported option.
181+ open Package.swift
185182
186- Pull from [ CocoaPods ] ( https://cocoapods.org/pods/crs-ios ) :
183+ ### Include Library ###
187184
188- pod 'crs-ios', '~> 1.0.5'
185+ Use this library via SPM in your Package.swift:
189186
190- Pull from GitHub:
187+ dependencies: [
188+ .package(url: "https://github.com/ngageoint/coordinate-reference-systems-ios.git", branch: "release/2.0.0"),
189+ ]
190+
191+ Or as a tagged release:
191192
192- pod 'crs-ios', :git => 'https://github.com/ngageoint/coordinate-reference-systems-ios.git', :branch => 'master'
193- pod 'crs-ios', :git => 'https://github.com/ngageoint/coordinate-reference-systems-ios.git', :tag => '1.0.5'
193+ dependencies: [
194+ .package(url: "https://github.com/ngageoint/coordinate-reference-systems-ios.git", from: "2.0.0"),
195+ ]
194196
195- Include as local project :
197+ Reference it in your Package.swift target :
196198
197- pod 'crs-ios', :path => '../coordinate-reference-systems-ios'
199+ .target(
200+ name: "projections",
201+ dependencies: [
202+ .product(name: "CoordinateReferenceSystems", package: "coordinate-reference-systems-ios"),
203+ ],
204+ ),
198205
199206### Swift ###
200207
201- To use from Swift, import the crs-ios bridging header from the Swift project's bridging header
202-
203- #import "crs-ios-Bridging-Header.h"
208+ Import the framework in Swift.
204209
205210``` swift
211+ import CoordinateReferenceSystems
206212
207213// var wkt: String = ...
208214
@@ -216,44 +222,44 @@ let prettyText : String = CRSWriter.writePretty(crs)
216222
217223switch category{
218224
219- case CRS_CATEGORY_CRS :
225+ case . CATEGORY_CRS :
220226
221227 let coordRefSys : CRSCoordinateReferenceSystem = crs as! CRSCoordinateReferenceSystem
222228
223229 switch type {
224- case CRS_TYPE_BOUND :
230+ case . TYPE_BOUND :
225231 let bound : CRSBoundCoordinateReferenceSystem = coordRefSys as! CRSBoundCoordinateReferenceSystem
226232 // ...
227233 break
228- case CRS_TYPE_COMPOUND :
234+ case . TYPE_COMPOUND :
229235 let compound : CRSCompoundCoordinateReferenceSystem = coordRefSys as! CRSCompoundCoordinateReferenceSystem
230236 // ...
231237 break
232- case CRS_TYPE_DERIVED :
238+ case . TYPE_DERIVED :
233239 let derived : CRSDerivedCoordinateReferenceSystem = coordRefSys as! CRSDerivedCoordinateReferenceSystem
234240 // ...
235241 break
236- case CRS_TYPE_ENGINEERING :
242+ case . TYPE_ENGINEERING :
237243 let engineering : CRSEngineeringCoordinateReferenceSystem = coordRefSys as! CRSEngineeringCoordinateReferenceSystem
238244 // ...
239245 break
240- case CRS_TYPE_GEODETIC, CRS_TYPE_GEOGRAPHIC :
246+ case . TYPE_GEODETIC , . TYPE_GEOGRAPHIC :
241247 let geo : CRSGeoCoordinateReferenceSystem = coordRefSys as! CRSGeoCoordinateReferenceSystem
242248 // ...
243249 break
244- case CRS_TYPE_PARAMETRIC :
250+ case . TYPE_PARAMETRIC :
245251 let parametric : CRSParametricCoordinateReferenceSystem = coordRefSys as! CRSParametricCoordinateReferenceSystem
246252 // ...
247253 break
248- case CRS_TYPE_PROJECTED :
254+ case . TYPE_PROJECTED :
249255 let projected : CRSProjectedCoordinateReferenceSystem = coordRefSys as! CRSProjectedCoordinateReferenceSystem
250256 // ...
251257 break
252- case CRS_TYPE_TEMPORAL :
258+ case . TYPE_TEMPORAL :
253259 let temporal : CRSTemporalCoordinateReferenceSystem = coordRefSys as! CRSTemporalCoordinateReferenceSystem
254260 // ...
255261 break
256- case CRS_TYPE_VERTICAL :
262+ case . TYPE_VERTICAL :
257263 let vertical : CRSVerticalCoordinateReferenceSystem = coordRefSys as! CRSVerticalCoordinateReferenceSystem
258264 // ...
259265 break
@@ -264,27 +270,27 @@ case CRS_CATEGORY_CRS:
264270 // ...
265271 break
266272
267- case CRS_CATEGORY_METADATA :
273+ case . CATEGORY_METADATA :
268274
269275 let metadata : CRSCoordinateMetadata = crs as! CRSCoordinateMetadata
270276
271277 // ...
272278 break
273279
274- case CRS_CATEGORY_OPERATION :
280+ case . CATEGORY_OPERATION :
275281
276282 let operation = crs as! CRSOperation
277283
278284 switch type {
279- case CRS_TYPE_CONCATENATED_OPERATION :
285+ case . TYPE_CONCATENATED_OPERATION :
280286 let concatenatedOperation : CRSConcatenatedOperation = operation as! CRSConcatenatedOperation
281287 // ...
282288 break
283- case CRS_TYPE_COORDINATE_OPERATION :
289+ case . TYPE_COORDINATE_OPERATION :
284290 let coordinateOperation : CRSCoordinateOperation = operation as! CRSCoordinateOperation
285291 // ...
286292 break
287- case CRS_TYPE_POINT_MOTION_OPERATION :
293+ case . TYPE_POINT_MOTION_OPERATION :
288294 let pointMotionOperation : CRSPointMotionOperation = operation as! CRSPointMotionOperation
289295 // ...
290296 break
0 commit comments