{"id":15055320,"url":"https://github.com/mijick/navigationview","last_synced_at":"2025-12-11T23:01:37.999Z","repository":{"id":175884053,"uuid":"648838934","full_name":"Mijick/NavigationView","owner":"Mijick","description":"Navigation made simple (SwiftUI)","archived":false,"fork":false,"pushed_at":"2024-07-17T20:15:09.000Z","size":55,"stargazers_count":297,"open_issues_count":9,"forks_count":20,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T09:17:58.472Z","etag":null,"topics":["ios-swift","navigation","navigationstack","navigationview","swift","swift-package","swift-package-manager","swift-packages","swift5","swiftlibrary","swiftnavigation","swiftpackagemanager","swiftui","swiftui-components","swiftui-framework"],"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/Mijick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"mijick","custom":null}},"created_at":"2023-06-03T00:40:05.000Z","updated_at":"2025-04-02T18:09:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"f962f101-45fd-4a34-9c02-880f79582621","html_url":"https://github.com/Mijick/NavigationView","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"27382220d4a63fadc3212311556d1f1bdbc142c6"},"previous_names":["mijick/navigattie","mijick/navigationview"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mijick%2FNavigationView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mijick%2FNavigationView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mijick%2FNavigationView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mijick%2FNavigationView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mijick","download_url":"https://codeload.github.com/Mijick/NavigationView/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247622985,"owners_count":20968575,"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":["ios-swift","navigation","navigationstack","navigationview","swift","swift-package","swift-package-manager","swift-packages","swift5","swiftlibrary","swiftnavigation","swiftpackagemanager","swiftui","swiftui-components","swiftui-framework"],"created_at":"2024-09-24T21:40:50.532Z","updated_at":"2025-12-11T23:01:32.718Z","avatar_url":"https://github.com/Mijick.png","language":"Swift","readme":"\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e \n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Logotype/On%20Dark.svg\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Logotype/On%20Light.svg\"\u003e\n    \u003cimg alt=\"NavigationView Logo\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Logotype/On%20Dark.svg\" width=\"76%\"\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003ch3 style=\"font-size: 5em\" align=\"center\"\u003e\n    Navigation made simple\n\u003c/h3\u003e\n                                                                                                                                          \n\u003cp align=\"center\"\u003e\n    Improve the navigation in your project in no time. Keep your code clean\n\u003c/p\u003e\n                 \n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Mijick/NavigationView-Demo\" rel=\"nofollow\"\u003eTry demo we prepared\u003c/a\u003e\n    |\n    \u003ca href=\"https://mijick.notion.site/1308512b2a6c483fb9a7e6804530ef87?v=6b992a9f361047348dfd9cc94c954b67\u0026pvs=74\" rel=\"nofollow\"\u003eRoadmap\u003c/a\u003e\n    |\n    \u003ca href=\"https://github.com/Mijick/NavigationView/issues/new\" rel=\"nofollow\"\u003ePropose a new feature\u003c/a\u003e\n\u003c/p\u003e\n                                                                      \n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Designed for SwiftUI\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Labels/Language.svg\"/\u003e\n    \u003cimg alt=\"Platforms: iOS\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Labels/Platforms.svg\"/\u003e\n    \u003cimg alt=\"Current Version\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Labels/Version.svg\"/\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Labels/License.svg\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Made in Kraków\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Labels/Origin.svg\"/\u003e\n    \u003ca href=\"https://twitter.com/MijickTeam\"\u003e\n        \u003cimg alt=\"Follow us on X\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Labels/X.svg\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=mailto:team@mijick.com?subject=Hello\u003e\n        \u003cimg alt=\"Let's work together\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Labels/Work%20with%20us.svg\"/\u003e\n    \u003c/a\u003e  \n    \u003ca href=\"https://github.com/Mijick/NavigationView/stargazers\"\u003e\n        \u003cimg alt=\"Stargazers\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/Labels/Stars.svg\"/\u003e\n    \u003c/a\u003e                                                                                                               \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"NavigationView Examples\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/GIFs/NavigationView-1.gif\" width=\"24.5%\"/\u003e\n    \u003cimg alt=\"NavigationView Examples\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/GIFs/NavigationView-2.gif\" width=\"24.5%\"/\u003e\n    \u003cimg alt=\"NavigationView Examples\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/GIFs/NavigationView-3.gif\" width=\"24.5%\"/\u003e\n    \u003cimg alt=\"NavigationView Examples\" src=\"https://github.com/Mijick/Assets/blob/main/NavigationView/GIFs/NavigationView-4.gif\" width=\"24.5%\"/\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\nNavigationView by Mijick is a powerful, open-source library dedicated for SwiftUI that makes navigation process super easy and much cleaner.\n* **Custom animations.** Our library provides full support for any animation.\n* **Gesture support.** You can easily enable navigation gestures for a selected screen. \n* **Remembers the current scroll view offset.** Library automatically saves the current scroll view offset when you leave the view.\n* **Improves code quality.** Navigate through your screens with just one line of code. Focus on what’s important to you and your project, not on Swift's intricacies.\n* **Stability at last!** At Mijick, we are aware of the problems that were (and still are) with the native NavigationView and how many problems it caused to developers. Therefore, during the development process we put the greatest emphasis on the reliability and performance of the library.\n* **Designed for SwiftUI.** While developing the library, we have used the power of SwiftUI to give you powerful tool to speed up your implementation process.\n\n\u003cbr\u003e \n\n# Getting Started\n### ✋ Requirements\n\n| **Platforms** | **Minimum Swift Version** |\n|:----------|:----------|\n| iOS 15+ | 5.0 |\n\n### ⏳ Installation\n    \n#### [Swift package manager][spm]\nSwift package manager is a tool for automating the distribution of Swift code and is integrated into the Swift compiler.\n\nOnce you have your Swift package set up, adding NavigationView as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```Swift\ndependencies: [\n    .package(url: \"https://github.com/Mijick/NavigationView\", branch(“main”))\n]\n```\n\n\n#### [Cocoapods][cocoapods]   \nCocoapods is a dependency manager for Swift and Objective-C Cocoa projects that helps to scale them elegantly.\n\nInstallation steps:\n- Install CocoaPods 1.10.0 (or later)\n- [Generate CocoaPods][generate_cocoapods] for your project\n```Swift\npod init\n```\n- Add CocoaPods dependency into your `Podfile`   \n```Swift\npod 'MijickNavigationView'\n```\n- Install dependency and generate `.xcworkspace` file\n```Swift\npod install\n```\n- Use new XCode project file `.xcworkspace`\n\u003cbr\u003e\n\n    \n# Usage\n### 1. Setup library\nInside your `@main` structure, call the `implementNavigationView` method with the view that is to be the root of the navigation stack. The view must be of type `NavigatableView`. The method takes an optional argument - `config`, which can be used to configure certain attributes of all the views that will be placed in the navigation stack.     \n```Swift\n@main struct NavigationView_Main: App {\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n               .implementNavigationView(config: nil)                    \n        }\n    }\n}\n```\n                      \n### 2. Declare a view to be pushed to the navigation stack\nNavigationView by Mijick provides the ability to push any view conforming to the `NavigatableView` protocol to the navigation stack. \n```Swift\nstruct ExampleView: NavigatableView {\n    ...\n}\n```\n                      \n### 3. Implement `body`\nFill your view with content           \n```Swift\nstruct ExampleView: NavigatableView {    \n    var body: some View {\n        VStack(spacing: 0) {\n            Text(\"Witaj okrutny świecie\")\n            Spacer()\n            Button(action: pop) { Text(\"Pop\") } \n        }\n    }\n    ...\n}\n```\n                      \n### 4. Implement `configure(view: NavigationConfig) -\u003e NavigationConfig` method\n*This step is optional - if you wish, you can skip this step and leave the configuration as default.*\u003cbr/\u003e\nEach view has its own set of methods that can be used to create a unique look for each view in the stack.            \n```Swift\nstruct ExampleView: NavigatableView {   \n    func configure(view: NavigationConfig) -\u003e NavigationConfig { view.backgroundColour(.red) }\n    var body: some View {\n        VStack(spacing: 0) {\n            Text(\"Witaj okrutny świecie\")\n            Spacer()\n            Button(action: pop) { Text(\"Pop\") } \n        }\n    }\n    ...\n}\n```\n                      \n### 5. Present your view - from any place in your code!\nJust call `ExampleView().push(with:)` from the selected place. As simple as that!            \n```Swift\nstruct SettingsViewModel {\n    ...\n    func openSettings() {\n        ...\n        ExampleView().push(with: .verticalSlide)\n        ...\n    }\n    ...\n}\n```\n                      \n### 6. Close your view - it's even simpler!\nThere are two ways to do this:\n- By calling one of the methods `pop`, `pop(to type:)`, `popToRoot` inside any view         \n```Swift\nstruct ExampleView: NavigatableView {\n    ...\n    func createButton() -\u003e some View {\n        Button(action: popToRoot) { Text(\"Tap to return to root\") } \n    }\n    ...\n}\n```\n- By calling one of the static `NavigationManager` methods:\n    - `NavigationManager.pop()`\n    - `NavigationManager.pop(to type:)` where type is the type of view you want to return to\n    - `NavigationManager.popToRoot()`\n \n### 7. Wait, there's even more!\nWe're almost done, but we'd like to describe three additional methods that you might like:\n- With the `setAsNewRoot` method you can change the root of your navigation stack:\n```Swift\nExampleView()\n    .push(with: .verticalSlide)\n    .setAsNewRoot()\n```\n\n- `EnvironmentObject` can be passed, but remember to do this **BEFORE** pushing the view to the stack:\n```Swift\nExampleView()\n    .environmentObject(object)\n    .push(with: .verticalSlide)\n```\n\n- Use `onFocus`, not `onAppear`\u003cbr\u003e\nIf you want to be notified every time a view is visible (is on top of the stack), use `onFocus` method:\n```Swift\nstruct ExampleView: NavigatableView {    \n    var body: some View {\n        VStack(spacing: 0) {\n            Text(\"Witaj okrutny świecie\")\n            Spacer()\n            Button(action: pop) { Text(\"Pop\") } \n        }\n        .onFocus(self) {\n            // Do something\n        }\n    }\n    ...\n}\n```\n\n\u003cbr\u003e\n      \n# Try our demo\nSee for yourself how does it work by cloning [project][Demo] we created\n                      \n# License\nNavigationView is released under the MIT license. See [LICENSE][License] for details.\n                      \n\u003cbr\u003e\u003cbr\u003e\n                      \n# Our other open source SwiftUI libraries\n[PopupView] - The most powerful popup library that allows you to present any popup\n\u003cbr\u003e\n[CalendarView] - Create your own calendar object in no time\n\u003cbr\u003e\n[GridView] - Lay out your data with no effort\n\u003cbr\u003e\n[CameraView] - The most powerful CameraController. Designed for SwiftUI\n\u003cbr\u003e\n[Timer] - Modern API for Timer\n\n\n                      \n[MIT]: https://en.wikipedia.org/wiki/MIT_License\n[spm]: https://www.swift.org/package-manager\n[cocoapods]: https://cocoapods.org/\n[generate_cocoapods]: https://github.com/square/cocoapods-generate\n                      \n[Demo]: https://github.com/Mijick/NavigationView-Demo\n[License]: https://github.com/Mijick/NavigationView/blob/main/LICENSE\n                     \n[PopupView]: https://github.com/Mijick/PopupView\n[CalendarView]: https://github.com/Mijick/CalendarView \n[CameraView]: https://github.com/Mijick/CameraView\n[GridView]: https://github.com/Mijick/GridView\n[Timer]: https://github.com/Mijick/Timer\n","funding_links":["https://buymeacoffee.com/mijick"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmijick%2Fnavigationview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmijick%2Fnavigationview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmijick%2Fnavigationview/lists"}