Mijick/NavigationView 是一个托管在 GitHub 上的开源项目,主要使用 Swift 编写,采用 MIT License 许可证,目前获得 319 个 Star、23 次 Fork。
仓库全名
Mijick/NavigationView
README 摘要
Navigation made simple Improve the navigation in your project in no time. Keep your code clean Try demo we prepared Roadmap Propose a new feature NavigationView by Mijick is a powerful, open-source library dedicated for SwiftUI that makes navigation process super easy and much cleaner. Custom animations. Our library provides full support for any animation. Gesture support. You can easily enable navigation gestures…
NavigationView by Mijick is a powerful, open-source library dedicated for SwiftUI that makes navigation process super easy and much cleaner.
Custom animations. Our library provides full support for any animation.
Gesture support. You can easily enable navigation gestures for a selected screen.
Remembers the current scroll view offset. Library automatically saves the current scroll view offset when you leave the view.
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.
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.
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.
Swift package manager is a tool for automating the distribution of Swift code and is integrated into the Swift compiler.
Once 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.
Inside 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.
@main struct NavigationView_Main: App {
var body: some Scene {
WindowGroup {
ContentView()
.implementNavigationView(config: nil)
}
}
}
2. Declare a view to be pushed to the navigation stack
NavigationView by Mijick provides the ability to push any view conforming to the NavigatableView protocol to the navigation stack.
This step is optional - if you wish, you can skip this step and leave the configuration as default.
Each view has its own set of methods that can be used to create a unique look for each view in the stack.
See for yourself how does it work by cloning project we created
License
NavigationView is released under the MIT license. See LICENSE for details.
Our other open source SwiftUI libraries
PopupView - The most powerful popup library that allows you to present any popup
CalendarView - Create your own calendar object in no time
GridView - Lay out your data with no effort
CameraView - The most powerful CameraController. Designed for SwiftUI
Timer - Modern API for Timer
评论