-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
383d917
commit 711daa7
Showing
4 changed files
with
86 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 CaptureContext | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,60 @@ | ||
# combine-cocoa-navigation | ||
|
||
[![SwiftPM 5.8](https://img.shields.io/badge/swiftpm-5.8-ED523F.svg?style=flat)](https://swift.org/download/) ! [![@maximkrouk](https://img.shields.io/badge/[email protected]?style=flat&logo=twitter)](https://twitter.com/capture_context) | ||
|
||
## Usage | ||
|
||
Basically all you need is to call `configureRoutes` method of the viewController, it accepts routing publisher and routeConfigurations, your code may look somewhat like this: | ||
|
||
```swift | ||
final class MyViewController: UIViewController { | ||
// ... | ||
|
||
func bindViewModel() { | ||
configureRoutes( | ||
for viewModel.publisher(for: \.state.route), | ||
routes: [ | ||
// Provide mapping from route to controller | ||
.associate(makeDetailsController, with: .details) | ||
], | ||
onDismiss: { | ||
// Update state on dismiss | ||
viewModel.send(.dismiss) | ||
} | ||
).store(in: &cancellables) | ||
} | ||
} | ||
``` | ||
|
||
## Installation | ||
|
||
### Basic | ||
|
||
You can add CombineNavigation to an Xcode project by adding it as a package dependency. | ||
|
||
1. From the **File** menu, select **Swift Packages › Add Package Dependency…** | ||
2. Enter [`"https://github.com/capturecontext/combine-cocoa-navigation.git"`](https://github.com/capturecontext/combine-cocoa-navigation.git) into the package repository URL text field | ||
3. Choose products you need to link them to your project. | ||
|
||
### Recommended | ||
|
||
If you use SwiftPM for your project, you can add CombineNavigation to your package file. | ||
|
||
```swift | ||
.package( | ||
url: "https://github.com/capturecontext/combine-cocoa-navigation.git", | ||
.upToNextMinor(from: "0.2.0") | ||
) | ||
``` | ||
|
||
Do not forget about target dependencies: | ||
|
||
```swift | ||
.product( | ||
name: "CombineNavigation", | ||
package: "combine-cocoa-navigation" | ||
) | ||
|
||
## License | ||
|
||
This package is released under the MIT license. See [LICENSE](./LICENSE) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters