Skip to content

Commit

Permalink
Fix creating nodes in body of windows + update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertDresler committed Jan 19, 2025
1 parent 92fa4a1 commit a52e556
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 11 deletions.
16 changes: 11 additions & 5 deletions Examples/Examples/Examples/Windows/AppWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@ import Shared
struct AppWindow: View {

@Environment(\.requestReview) private var requestReview
@ObservedObject private var rootNode: NavigationNode

var dependencies: Dependencies

init(dependencies: Dependencies) {
self.dependencies = dependencies
self.rootNode = AppNavigationNode(
flagsRepository: dependencies.flagsRepository,
deepLinkForwarderService: dependencies.deepLinkForwarderService,
onboardingService: dependencies.onboardingService
)
}

var body: some View {
NavigationWindow(
rootNode: AppNavigationNode(
flagsRepository: dependencies.flagsRepository,
deepLinkForwarderService: dependencies.deepLinkForwarderService,
onboardingService: dependencies.onboardingService
),
rootNode: rootNode,
defaultDeepLinkHandler: dependencies.defaultDeepLinkHandler
)
.registerCustomPresentableNavigationNodes([PhotosPickerPresentedNavigationNode.self])
Expand Down
14 changes: 10 additions & 4 deletions Examples/Examples/Examples/Windows/WaitingWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ import ExamplesNavigation

struct WaitingWindow: View {

@ObservedObject private var rootNode: NavigationNode
var dependencies: Dependencies

init(dependencies: Dependencies) {
self.dependencies = dependencies
self.rootNode = WaitingNavigationNode(
inputData: WaitingInputData(),
flagsRepository: dependencies.flagsRepository
)
}

var body: some View {
NavigationWindow(
rootNode: WaitingNavigationNode(
inputData: WaitingInputData(),
flagsRepository: dependencies.flagsRepository
),
rootNode: rootNode,
defaultDeepLinkHandler: dependencies.defaultDeepLinkHandler
)
}
Expand Down
22 changes: 22 additions & 0 deletions Examples/Examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Examples

## Getting Started

1. Have you downloaded the repo? Make sure to **rename** the downloaded folder to `SwiftUINavigation`

2. Open the app at path `SwiftUINavigation/Examples/Examples.xcodeproj`

3. Run the app

- On simulator
- On a real device (set your development team)

4. Explore the app

## Documentation

For the full documentation, refer to `SwiftUINavigation/README.md` or visit the [GitHub repo](https://github.com/RobertDresler/SwiftUINavigation).

## Issues

If you encounter any bugs or have a feature request, feel free to open an issue or a pull request in the repo.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ I highly recommend starting by exploring the Examples app. The app features many

To get started, first add the package to your project:

- In Xcode, add the package by using this URL: `https://github.com/RobertDresler/SwiftUINavigation` and choose the dependency rule **up to next major version** from `1.0.2`
- Alternatively, add it to your `Package.swift` file: `.package(url: "https://github.com/RobertDresler/SwiftUINavigation", from: "1.0.2")`
- In Xcode, add the package by using this URL: `https://github.com/RobertDresler/SwiftUINavigation` and choose the dependency rule **up to next major version** from `1.0.3`
- Alternatively, add it to your `Package.swift` file: `.package(url: "https://github.com/RobertDresler/SwiftUINavigation", from: "1.0.3")`

Once the package is added, you can copy this code and begin exploring the framework by yourself:

Expand Down

0 comments on commit a52e556

Please sign in to comment.