{"id":21619097,"url":"https://github.com/bannzai/navigationcontroller","last_synced_at":"2025-04-11T08:42:57.063Z","repository":{"id":226550287,"uuid":"768992600","full_name":"bannzai/NavigationController","owner":"bannzai","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-08T10:42:39.000Z","size":12,"stargazers_count":34,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T05:00:01.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bannzai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-08T05:49:24.000Z","updated_at":"2025-02-19T13:53:12.000Z","dependencies_parsed_at":"2024-03-08T07:50:20.116Z","dependency_job_id":null,"html_url":"https://github.com/bannzai/NavigationController","commit_stats":null,"previous_names":["bannzai/navigationcontroller"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bannzai%2FNavigationController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bannzai%2FNavigationController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bannzai%2FNavigationController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bannzai%2FNavigationController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bannzai","download_url":"https://codeload.github.com/bannzai/NavigationController/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248362518,"owners_count":21091145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T23:07:54.756Z","updated_at":"2025-04-11T08:42:57.039Z","avatar_url":"https://github.com/bannzai.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# NavigationController\n\n`NavigationController` is a Swift Package designed to simplify and efficiently manage navigation within SwiftUI applications. Leveraging SwiftUI's `NavigationStack` and `NavigationPath`, it aims to make the implementation of navigation flows between screens as straightforward as possible. This package is created with the goal of\n\n\n## Features\n\n- Simple API for implementing navigation transitions\n- Utilizes SwiftUI's `NavigationStack` and `NavigationPath` for navigation management\n- Supports sharing navigation state across multiple screens\n- Facilitates programmatic navigation between views\n\n## Installation\n\n### Swift Package Manager\n\n`NavigationController` can be added to your project using the Swift Package Manager. In Xcode, select \"File\" \u003e \"Swift Packages\" \u003e \"Add Package Dependency...\" and enter the following repository URL:\n\n\n## Usage\n\nTo use `NavigationController`, apply the `WithNavigationModifier` modifier to the SwiftUI view you want to manage navigation for. Then, control the navigation between screens using instances of `NavigationController`.\n\n```swift\nstruct ContentView: View {\n  var body: some View {\n    RootView()\n      .withNavigation()\n  }\n}\n\nstruct RootView: View {\n  // Retrieve navigationController via EnvironmentObject\n  @EnvironmentObject var navigationController: NavigationController\n\n  var body: some View {\n    VStack {\n      // Use navigationController ...\n    }\n  }\n}\n```\n\nTo push a screen:\n\n```swift\nButton {\n  navigationController.push { \n    YourDestinationView() \n  }\n} label: {\n  Text(\"Push\")\n}\n```\n\nTo pop a screen\n\n```swift\nButton {\n  navigationController.pop()\n} label: {\n  Text(\"Pop\")\n}\n```\n\nEdit path directly. For example edit path and pop.\n\n```swift\nButton {\n  navigationController.path.removeLast()\n} label: {\n  Text(\"Edit path and pop\")\n}\n```\n\n## LICENSE\n**NavigationController** is released under the MIT License. For more details, please see the LICENSE file.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbannzai%2Fnavigationcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbannzai%2Fnavigationcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbannzai%2Fnavigationcontroller/lists"}