Skip to content

Commit a2154a5

Browse files
bdunay3Bill Dunayalbertbori
authored
Added support for tvOS and watchOS (#37)
* Added support for tvOS and watchOS * Updated documenation with references to the new platforms * Update README.md * Updated CI workflow to run tests on macOS * Added watchOS and tvOS test destinations for CI ran unit tests --------- Co-authored-by: Bill Dunay <wdunay@wayfair.com> Co-authored-by: Albert Bori <github@albertbori.com>
1 parent ad9a158 commit a2154a5

File tree

9 files changed

+44
-9
lines changed

9 files changed

+44
-9
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,38 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v3
2121

22-
- name: Build and Test VSM
22+
- name: Build and Test VSM on macOS
23+
uses: sersoft-gmbh/xcodebuild-action@v2 # https://github.com/marketplace/actions/xcodebuild-action
24+
with:
25+
spm-package: ./
26+
scheme: VSM
27+
destination: platform=macOS,arch=x86_64
28+
action: test
29+
30+
- name: Build and Test VSM on iOS
2331
uses: sersoft-gmbh/xcodebuild-action@v2 # https://github.com/marketplace/actions/xcodebuild-action
2432
with:
2533
spm-package: ./
2634
scheme: VSM
2735
destination: platform=iOS Simulator,OS=latest,name=iPhone 14
2836
action: test
37+
38+
- name: Build and Test VSM on watchOS
39+
uses: sersoft-gmbh/xcodebuild-action@v2 # https://github.com/marketplace/actions/xcodebuild-action
40+
with:
41+
spm-package: ./
42+
scheme: VSM
43+
destination: platform=watchOS Simulator,OS=latest,name=Apple Watch SE (40mm) (2nd generation)
44+
action: test
45+
46+
- name: Build and Test VSM on tvOS
47+
uses: sersoft-gmbh/xcodebuild-action@v2 # https://github.com/marketplace/actions/xcodebuild-action
48+
with:
49+
spm-package: ./
50+
scheme: VSM
51+
destination: platform=tvOS Simulator,OS=latest,name=Apple TV
52+
action: test
53+
2954

3055
test-swiftui-demo-app:
3156
runs-on: macos-12

Package.resolved

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

Package.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ let package = Package(
77
name: "VSM",
88
platforms: [
99
.iOS(.v13),
10-
.macOS(.v11)
10+
.macOS(.v11),
11+
.watchOS(.v6),
12+
.tvOS(.v13)
1113
],
1214
products: [
1315
.library(
@@ -16,7 +18,7 @@ let package = Package(
1618
],
1719
dependencies: [
1820
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
19-
.package(url: "https://github.com/albertbori/TestableCombinePublishers.git", from: "1.0.0")
21+
.package(url: "https://github.com/albertbori/TestableCombinePublishers.git", from: "1.2.1")
2022
],
2123
targets: [
2224
.target(

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE_OF_CONDUCT.md)
55
[![Maintainer](https://img.shields.io/badge/Maintainer-Wayfair-7F187F)](https://wayfair.github.io)
66

7-
# VSM for iOS
7+
# VSM for Apple Platforms
88

9-
VSM is a reactive architecture that is unidirectional, highly type-safe, behavior-driven, and clean. This repository hosts an open-source swift package framework for easily building features in VSM on iOS.
9+
VSM is a reactive architecture that is unidirectional, highly type-safe, behavior-driven, and clean. This repository hosts an open-source swift package framework for easily building features in VSM on app publicly available Apple platforms.
1010

1111
## Overview
1212

@@ -114,7 +114,7 @@ For more detailed tutorials and documentation, visit the [VSM Documentation](htt
114114

115115
### Credits
116116

117-
VSM for iOS is owned and [maintained](MAINTAINERS.md) by [Wayfair](https://www.wayfair.com/).
117+
VSM for Apple platforms is owned and [maintained](MAINTAINERS.md) by [Wayfair](https://www.wayfair.com/).
118118

119119
### Contributing
120120

@@ -126,4 +126,4 @@ See [SECURITY.md](SECURITY.md).
126126

127127
### License
128128

129-
VSM for iOS is released under the MIT license. See [LICENSE](LICENSE) for details.
129+
VSM for Apple platforms is released under the MIT license. See [LICENSE](LICENSE) for details.

Sources/VSM/StateObject+StateInit.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import SwiftUI
1010

1111
@available(macOS 11.0, *)
1212
@available(iOS 14.0, *)
13+
@available(tvOS 14.0, *)
14+
@available(watchOS 7.0, *)
1315
@available(*, deprecated, message: "Use the @ViewState property wrapper instead.")
1416
public extension StateObject {
1517

Sources/VSM/ViewState/ViewState+Debug.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#if DEBUG
99

1010
@available(iOS 14.0, *)
11+
@available(tvOS 14.0, *)
12+
@available(watchOS 7.0, *)
1113
extension ViewState: _StateContainerStaticDebugging where State == Any { }
1214

1315
#endif

Sources/VSM/ViewState/ViewState.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import SwiftUI
3232
/// }
3333
/// ```
3434
@available(iOS 14.0, *)
35+
@available(tvOS 14.0, *)
36+
@available(watchOS 7.0, *)
3537
@propertyWrapper
3638
public struct ViewState<State>: DynamicProperty {
3739

Tests/VSMTests/StateObservingTests/ViewStateObservingTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import XCTest
1010
import SwiftUI
1111

1212
@available(iOS 14.0, *)
13+
@available(tvOS 14.0, *)
1314
final class ViewStateObservingTests: StateObservingTests {
1415

1516
override func setUp() {

Tests/VSMTests/StatePublishingTests/ViewStatePublishingTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import XCTest
1010

1111
@available(iOS 14.0, *)
12+
@available(tvOS 14.0, *)
1213
final class ViewStatePublishingTests: StatePublishingTests {
1314

1415
override func setUp() {

0 commit comments

Comments
 (0)