You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-7Lines changed: 31 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,24 +81,48 @@ struct CounterApp: App {
81
81
}
82
82
```
83
83
84
-
Clone the SwiftCrossUI repository to test out this example, and many more;
84
+
Clone the SwiftCrossUI repository to test out this example and others. Running the examples requires an installation of [Swift Bundler](https://github.com/stackotter/swift-bundler), which provides consistent behavior across platforms and enables running on iOS and tvOS simulators and devices.
85
+
86
+
To install Swift Bundler, you can follow [its official installation instructions](https://github.com/stackotter/swift-bundler?tab=readme-ov-file#installation-). Swift Bundler is typically installed using [Mint](https://github.com/yonaskolb/Mint?tab=readme-ov-file#installing), a Swift package manager that lets you easily install and run CLI tools distributed as Swift packages.
87
+
88
+
If you don't have Mint installed, you can install it with [Homebrew](https://brew.sh/):
The examples are written as Swift packages, which means you can't run them on iOS directly without creating an Xcode project. By using tools like [`mint`](https://github.com/yonaskolb/Mint) and [`swift-bundler`](https://github.com/stackotter/swift-bundler), running these apps on the iOS Simulator becomes much easier.
94
+
Then use Mint to install Swift Bundler:
93
95
94
96
```sh
95
-
brew install mint
96
97
mint install stackotter/swift-bundler@main
98
+
```
99
+
100
+
Once installed, clone the project and run the example:
swift bundler run CounterExample --simulator "iPhone"
105
+
swift bundler run CounterExample
100
106
```
101
107
108
+
You can also run on iOS and tvOS:
109
+
110
+
```sh
111
+
# On a connected device with "iPhone" in its name (macOS only)
112
+
swift bundler run CounterExample device iPhone
113
+
114
+
# On a simulator with "iPhone 16" in its name (macOS only)
115
+
swift bundler run CounterExample simulator "iPhone 16"
116
+
```
117
+
118
+
These examples may also be run on your host machine without Swift Bundler by using SwiftPM:
119
+
120
+
```sh
121
+
swift run CounterExample
122
+
```
123
+
124
+
However, resources may not be loaded as expected, and features like deep linking may not work. This method also does not support running on iOS or tvOS.
125
+
102
126
The documentation contains [a detailed list of all examples](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/examples)
0 commit comments