|
2 | 2 |
|
3 | 3 | An iOS 14 Shortcuts creator written in Swift, inspired by SwiftUI. |
4 | 4 |
|
5 | | -## Getting Started |
| 5 | +## Installation |
6 | 6 |
|
7 | | -Add the following line to your `Package.swift`: |
| 7 | +SwiftShortcuts is distributed using the [Swift Package Manager](https://swift.org/package-manager/). To install it into a project, add it as a dependency within your `Package.swift` manifest: |
8 | 8 |
|
9 | 9 | ```swift |
10 | | -.package(url: "https://github.com/a2/swift-shortcuts.git", from: "1.0.0") |
| 10 | +let package = Package( |
| 11 | + ... |
| 12 | + dependencies: [ |
| 13 | + .package(url: "https://github.com/a2/swift-shortcuts.git", from: "0.1.0") |
| 14 | + ], |
| 15 | + ... |
| 16 | +) |
11 | 17 | ``` |
12 | 18 |
|
13 | | -Then you can import `SwiftShortcuts` in your project. |
| 19 | +Then import SwiftShortcuts in your project wherever you'd like to use it: |
| 20 | + |
| 21 | +```swift |
| 22 | +import SwiftShortcuts |
| 23 | +``` |
| 24 | + |
| 25 | +## Getting Started |
14 | 26 |
|
15 | 27 | SwiftShorcuts was inspired by SwiftUI and, just as every SwiftUI `View` is made from other `View` types, so too is every `Shortcut` built from other `Shortcut` types. The only requirement of the `Shortcut` protocol is an instance property named `body` whose type is another `Shortcut`: |
16 | 28 |
|
@@ -187,6 +199,26 @@ struct ShortenWithSmallCatShortcut: Shortcut { |
187 | 199 | } |
188 | 200 | ``` |
189 | 201 |
|
| 202 | +## Design and Goals |
| 203 | + |
| 204 | +SwiftShortcuts began as the similarly named [ShortcutsSwift](https://github.com/a2/shortcuts-swift) and was originally inspired by [Shortcuts JS](https://github.com/joshfarrant/shortcuts-js). Both SwiftShortcuts, and ShortcutsSwift before it, aimed to be in Swift what Shortcuts JS is for JavaScript. |
| 205 | + |
| 206 | +The goal of this iteration of SwiftShortcuts is to make writing Shortcuts app workflows in Swift as easy as composing `View`s in SwiftUI. As you can see [above](#getting-started), even the base `Shortcut` protocol is heavily inspired by SwiftUI's `View` protocol. |
| 207 | + |
| 208 | +This repository does not contain every possible Shortcuts-supported action or every possible permutation of parametres for those shortcuts. Please feel free to [contribute](#contributions-and-support) missing shortcut types and even test cases. |
| 209 | + |
190 | 210 | ## License |
191 | 211 |
|
192 | 212 | SwiftShortcuts is available under the MIT license. See the [LICENSE](LICENSE) file for more info. |
| 213 | + |
| 214 | +## Contributions and Support |
| 215 | + |
| 216 | +*Inspired by the support model behind [Publish](https://github.com/JohnSundell/Publish).* |
| 217 | + |
| 218 | +SwiftShortcuts is developed completely in the open, and your contributions are more than welcome. |
| 219 | + |
| 220 | +This project does not come with GitHub Issues-based support, and users are instead encouraged to become active participants in its continued development — by fixing any bugs that they encounter, or by improving the documentation wherever it's found to be lacking. |
| 221 | + |
| 222 | +If you wish to make a change, [open a Pull Request](https://github.com/a2/swift-shortcuts/compare) — even if it just contains a draft of the changes you're planning, or a test that reproduces an issue — and we can discuss it further from there. |
| 223 | + |
| 224 | +Hope you'll enjoy using SwiftShortcuts! |
0 commit comments