Skip to content

Commit 5e33516

Browse files
Merge pull request #14 from ngageoint/psolt/package
Adds Swift Package Manager Support and Update NS_ENUM (SimpleFeatures 5.0.0) for Swift Interoperability.
2 parents 1156202 + 98d9370 commit 5e33516

36 files changed

+190
-985
lines changed

.github/workflows/build-test.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches-ignore:
66
- master
7+
pull_request:
78

89
jobs:
910

@@ -13,8 +14,8 @@ jobs:
1314

1415
steps:
1516
- name: Checkout Repository
16-
uses: actions/checkout@v3
17-
- name: Install
18-
run: pod install
17+
uses: actions/checkout@v4
1918
- name: Build
20-
run: xcodebuild build-for-testing -workspace sf-wkb-ios.xcworkspace -scheme sf-wkb-ios -destination 'platform=iOS Simulator,OS=latest,name=iPhone 14'
19+
run: swift build
20+
- name: Test
21+
run: swift test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Pods
55
xcuserdata/
66
*.swp
77
Carthage/
8+
.build/

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Adheres to [Semantic Versioning](http://semver.org/).
44

55
---
66

7-
## 4.1.5 (TBD)
7+
## 5.0.0 (6-4-2025)
88

9-
* TBD
9+
* Adds Swift Package support and removes Cocoapods support (since it's deprecated).
10+
* Integrates sf-ios 5.0.0 (SimpleFeatures) breaking code chanegs for NS_ENUM.
11+
* Updates existing enums to NS_ENUM for Swift for Objective-C interoperability.
1012

1113
## [4.1.4](https://github.com/ngageoint/simple-features-wkb-ios/releases/tag/4.1.4) (04-08-2024)
1214

Cartfile

Whitespace-only changes.

Cartfile.resolved

Whitespace-only changes.

Package.resolved

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// swift-tools-version: 5.10
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "SimpleFeaturesWKB",
7+
platforms: [.macOS(.v11), .iOS(.v13)],
8+
products: [
9+
.library(
10+
name: "SimpleFeaturesWKB",
11+
targets: ["SimpleFeaturesWKB"]),
12+
],
13+
dependencies: [
14+
.package(url: "https://github.com/ngageoint/simple-features-ios", from: "5.0.0"),
15+
],
16+
targets: [
17+
.target(
18+
name: "SimpleFeaturesWKB",
19+
dependencies: [
20+
.product(name: "SimpleFeatures", package: "simple-features-ios")
21+
],
22+
path: "sf-wkb-ios",
23+
publicHeadersPath: "include"
24+
),
25+
.testTarget(
26+
name: "SimpleFeaturesWKBTests",
27+
dependencies: [
28+
"SimpleFeaturesWKB",
29+
"TestUtils"
30+
],
31+
path: "sf-wkb-iosTests"
32+
),
33+
.testTarget(
34+
name: "SimpleFeaturesWKBTestsSwift",
35+
dependencies: [
36+
"SimpleFeaturesWKB",
37+
"TestUtils"
38+
],
39+
path: "sf-wkb-iosTests-swift"
40+
),
41+
.target(
42+
name: "TestUtils", // Shared test code
43+
dependencies: ["SimpleFeaturesWKB"],
44+
path: "TestUtils",
45+
publicHeadersPath: ""
46+
),
47+
]
48+
)

Podfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ View the latest [Appledoc](http://ngageoint.github.io/simple-features-wkb-ios/do
2424
// NSData *data = ...
2525

2626
SFGeometry *geometry = [SFWBGeometryReader readGeometryWithData:data];
27-
enum SFGeometryType geometryType = geometry.geometryType;
27+
SFGeometryType geometryType = geometry.geometryType;
2828

2929
```
3030
@@ -40,44 +40,49 @@ NSData *data = [SFWBGeometryWriter writeGeometry:geometry];
4040

4141
### Build ###
4242

43-
[![Build & Test](https://github.com/ngageoint/simple-features-wkb-ios/workflows/Build%20&%20Test/badge.svg)](https://github.com/ngageoint/simple-features-wkb-ios/actions/workflows/build-test.yml)
43+
[![Build](https://github.com/ngageoint/simple-features-wkb-ios/actions/workflows/build.yml/badge.svg)](https://github.com/ngageoint/simple-features-wkb-ios/actions/workflows/build.yml)
4444

45-
Build this repository using Xcode and/or CocoaPods:
45+
Build this repository using SPM:
4646

47-
pod repo update
48-
pod install
47+
swift build
4948

50-
Open sf-wkb-ios.xcworkspace in Xcode or build from command line:
49+
Open the Swift Package in Xcode:
5150

52-
xcodebuild -workspace 'sf-wkb-ios.xcworkspace' -scheme sf-wkb-ios build
51+
open Package.swift
5352

5453
Run tests from Xcode or from command line:
5554

56-
xcodebuild test -workspace 'sf-wkb-ios.xcworkspace' -scheme sf-wkb-ios -destination 'platform=iOS Simulator,name=iPhone 15'
55+
swift test
5756

5857
### Include Library ###
5958

60-
Include this repository by specifying it in a Podfile using a supported option.
59+
Add a package dependency version:
6160

62-
Pull from [CocoaPods](https://cocoapods.org/pods/sf-wkb-ios):
61+
.package(url: "https://github.com/ngageoint/simple-features-wkb-ios", from: "5.0.0"),
6362

64-
pod 'sf-wkb-ios', '~> 4.1.4'
63+
# Or specific branch:
6564

66-
Pull from GitHub:
65+
.package(url: "https://github.com/ngageoint/simple-features-wkb-ios", branch: "release/5.0.0"),
66+
67+
# Or as a local dependency:
6768

68-
pod 'sf-wkb-ios', :git => 'https://github.com/ngageoint/simple-features-wkb-ios.git', :branch => 'master'
69-
pod 'sf-wkb-ios', :git => 'https://github.com/ngageoint/simple-features-wkb-ios.git', :tag => '4.1.4'
69+
.package(name: "simple-features-wkb-ios", path: "../simple-features-wkb-ios"),
7070

71-
Include as local project:
71+
Use it in a target:
7272

73-
pod 'sf-wkb-ios', :path => '../simple-features-wkb-ios'
73+
.target(
74+
name: "MyLibrary",
75+
dependencies: [
76+
.product(name: "SimpleFeaturesWKB", package: "simple-features-wkb-ios")
77+
]
78+
)
7479

7580
### Swift ###
7681

77-
To use from Swift, import the sf-wkb-ios bridging header from the Swift project's bridging header
78-
79-
#import "sf-wkb-ios-Bridging-Header.h"
82+
To use from Swift, import the framework:
8083

84+
import SimpleFeaturesWKB
85+
8186
#### Read ####
8287

8388
```swift

0 commit comments

Comments
 (0)