Skip to content

Commit 3a5af18

Browse files
feat: Adds watchOS / tvOS support (#67)
## This PR - Adds support for `watchOS 7` and `tvOS 14` to the Swift SDK, matching the iOS minimum target version. - Updates tests to run against `iOS` / `macOS` / `watchOS` / `tvOS` --------- Signed-off-by: Jonathan Norris <[email protected]>
1 parent 2903008 commit 3a5af18

File tree

4 files changed

+43
-17
lines changed

4 files changed

+43
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,43 @@ name: CI
33
on:
44
pull_request:
55
branches:
6-
- 'main'
6+
- "main"
77
push:
88
branches:
9-
- 'main'
9+
- "main"
1010

1111
jobs:
1212
Tests:
1313
runs-on: macOS-latest
14+
strategy:
15+
matrix:
16+
platform: [iOS, macOS, watchOS, tvOS]
17+
include:
18+
- platform: iOS
19+
destination: "platform=iOS Simulator,name=iPhone 15"
20+
- platform: macOS
21+
destination: "platform=macOS"
22+
- platform: watchOS
23+
destination: "platform=watchOS Simulator,name=Apple Watch Series 10 (42mm)"
24+
- platform: tvOS
25+
destination: "platform=tvOS Simulator,name=Apple TV 4K (3rd generation)"
1426
steps:
15-
- uses: actions/checkout@v4
16-
- name: Build and Test
17-
run: swift test
27+
- uses: actions/checkout@v4
28+
- name: Build and Test on ${{ matrix.platform }}
29+
run: |
30+
if [ "${{ matrix.platform }}" = "macOS" ]; then
31+
swift test
32+
else
33+
xcodebuild test \
34+
-scheme OpenFeature \
35+
-destination "${{ matrix.destination }}"
36+
fi
1837
1938
SwiftLint:
2039
runs-on: ubuntu-latest
2140
steps:
22-
- uses: actions/checkout@v4
23-
- name: GitHub Action for SwiftLint
24-
uses: norio-nomura/[email protected]
25-
with:
26-
args: --config .swiftlint.yml
41+
- uses: actions/checkout@v4
42+
- name: GitHub Action for SwiftLint
43+
uses: norio-nomura/[email protected]
44+
with:
45+
args: --config .swiftlint.yml

OpenFeature.podspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Pod::Spec.new do |s|
33
s.version = '0.3.0' # x-release-please-version
44
s.summary = 'OpenFeature iOS SDK'
55
s.description = <<-DESC
6-
OpenFeature is an open specification that provides a vendor-agnostic, community-driven API for feature flagging that works with your favorite feature flag management tool or in-house solution.
6+
OpenFeature is an open specification that provides a vendor-agnostic, community-driven API for feature flagging that works with your favorite feature flag management tool or in-house solution. This Swift SDK supports iOS, macOS, watchOS, and tvOS.
77
DESC
88
s.homepage = 'https://github.com/open-feature/swift-sdk'
99
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' }
@@ -12,6 +12,8 @@ OpenFeature is an open specification that provides a vendor-agnostic, community-
1212

1313
s.ios.deployment_target = '14.0'
1414
s.osx.deployment_target = '11.0'
15+
s.watchos.deployment_target = '7.0'
16+
s.tvos.deployment_target = '14.0'
1517
s.swift_version = '5.5'
1618

1719
s.source_files = 'Sources/OpenFeature/**/*'

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ let package = Package(
88
platforms: [
99
.iOS(.v14),
1010
.macOS(.v11),
11+
.watchOS(.v7),
12+
.tvOS(.v14),
1113
],
1214
products: [
1315
.library(
1416
name: "OpenFeature",
15-
targets: ["OpenFeature"]),
16-
],
17-
dependencies: [
17+
targets: ["OpenFeature"])
1818
],
19+
dependencies: [],
1920
targets: [
2021
.target(
2122
name: "OpenFeature",

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@
3636

3737
### Requirements
3838

39-
- The minimum iOS version supported is: `iOS 14`.
39+
This SDK supports the following Apple platforms:
40+
- **iOS 14+**
41+
- **macOS 11+**
42+
- **watchOS 7+**
43+
- **tvOS 14+**
4044

41-
Note that this library is intended to be used in a mobile context, and has not been evaluated for use in other type of applications (e.g. server applications, macOS, tvOS, watchOS, etc.).
45+
The SDK is built with Swift 5.5+ and uses only Foundation and Combine frameworks, making it suitable for all Apple platform contexts including mobile, desktop, wearable, and TV applications.
4246

4347
### Install
4448

@@ -85,7 +89,7 @@ Then, run:
8589
pod install
8690
```
8791

88-
### Usage
92+
### iOS Usage
8993

9094
```swift
9195
import OpenFeature

0 commit comments

Comments
 (0)