Skip to content

feat: add watchOS and tvOS support to iOS SDK #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,43 @@ name: CI
on:
pull_request:
branches:
- 'main'
- "main"
push:
branches:
- 'main'
- "main"

jobs:
Tests:
runs-on: macOS-latest
strategy:
matrix:
platform: [iOS, macOS, watchOS, tvOS]
include:
- platform: iOS
destination: "platform=iOS Simulator,name=iPhone 15"
- platform: macOS
destination: "platform=macOS"
- platform: watchOS
destination: "platform=watchOS Simulator,name=Apple Watch Series 10 (42mm)"
- platform: tvOS
destination: "platform=tvOS Simulator,name=Apple TV 4K (3rd generation)"
steps:
- uses: actions/checkout@v4
- name: Build and Test
run: swift test
- uses: actions/checkout@v4
- name: Build and Test on ${{ matrix.platform }}
run: |
if [ "${{ matrix.platform }}" = "macOS" ]; then
swift test
else
xcodebuild test \
-scheme OpenFeature \
-destination "${{ matrix.destination }}"
fi

SwiftLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: GitHub Action for SwiftLint
uses: norio-nomura/action-swiftlint@3.2.1
with:
args: --config .swiftlint.yml
- uses: actions/checkout@v4
- name: GitHub Action for SwiftLint
uses: norio-nomura/action-swiftlint@3.2.1
with:
args: --config .swiftlint.yml
4 changes: 3 additions & 1 deletion OpenFeature.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
s.version = '0.3.0' # x-release-please-version
s.summary = 'OpenFeature iOS SDK'
s.description = <<-DESC
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.
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.
DESC
s.homepage = 'https://github.com/open-feature/swift-sdk'
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' }
Expand All @@ -12,6 +12,8 @@ OpenFeature is an open specification that provides a vendor-agnostic, community-

s.ios.deployment_target = '14.0'
s.osx.deployment_target = '11.0'
s.watchos.deployment_target = '7.0'
s.tvos.deployment_target = '14.0'
s.swift_version = '5.5'

s.source_files = 'Sources/OpenFeature/**/*'
Expand Down
7 changes: 4 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
platforms: [
.iOS(.v14),
.macOS(.v11),
.watchOS(.v7),
.tvOS(.v14),
],
products: [
.library(
name: "OpenFeature",
targets: ["OpenFeature"]),
],
dependencies: [
targets: ["OpenFeature"])

Check warning on line 17 in Package.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Comma Violation: Multi-line collection literals should have trailing commas (trailing_comma)
],
dependencies: [],
targets: [
.target(
name: "OpenFeature",
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@

### Requirements

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

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.).
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.

### Install

Expand Down Expand Up @@ -85,7 +89,7 @@ Then, run:
pod install
```

### Usage
### iOS Usage

```swift
import OpenFeature
Expand Down