hhru / nivelir Goto Github PK
View Code? Open in Web Editor NEWA Swift DSL for navigation in iOS and tvOS apps with a simplified, chainable, and compile time safe syntax
License: MIT License
A Swift DSL for navigation in iOS and tvOS apps with a simplified, chainable, and compile time safe syntax
License: MIT License
DefaultScreenIterator
works with standard controllers (such as UINavigationController
, UITabBarController
), but it doesn't work with non-native container view controllers (for example some custom bottom sheet controller or custom tab bar controller).
Of course, we can create our own implementation of ScreenIterator
, but it doesn't look nice, because it 's almost copy-paste of DefaultScreenIterator
. Moreover code is a bit tricky, so it's difficult to understand.
I think it would be a good idea to make DefaultScreenIterator
more flexible and easier to extend. In my fork I made that solution.
I can make PR or may be you have your own solution.
I have some issues when build Nivelir and Example app in Xcode 14, but it success and display some errors
I tried integrate Nivelir in my project by Carthage with Tuist but build failure
`*** Fetching Nivelir
*** Checking out Nivelir at "1.4.4"
*** No cache found for FirebaseAnalyticsBinary, building with all downstream dependencies
*** No cache found for FirebaseCrashlyticsBinary, building with all downstream dependencies
*** No cache found for Nivelir, building with all downstream dependencies
*** Downloading binary-only framework FirebaseAnalyticsBinary at "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
*** xcodebuild output can be found in /var/folders/mj/2bjgx7pd5jj7_vr_w39l2cl40000gp/T/carthage-xcodebuild.RQatES.log
*** Downloading binary-only framework FirebaseCrashlyticsBinary at "https://dl.google.com/dl/firebase/ios/carthage/FirebaseCrashlyticsBinary.json"
*** Building scheme "Nivelir iOS" in Nivelir.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/o.krasnov/Projects/qa-devices/src/Tuist/Dependencies/Carthage/Checkouts/Nivelir/Nivelir.xcodeproj -scheme Nivelir\ iOS -configuration Release -derivedDataPath /Users/o.krasnov/Library/Caches/org.carthage.CarthageKit/DerivedData/14.0_14A309/Nivelir/1.4.4 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO -archivePath /var/folders/mj/2bjgx7pd5jj7_vr_w39l2cl40000gp/T/Nivelir SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/o.krasnov/Projects/qa-devices/src/Tuist/Dependencies/Carthage/Checkouts/Nivelir)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/mj/2bjgx7pd5jj7_vr_w39l2cl40000gp/T/carthage-xcodebuild.RQatES.log
The 'carthage' command exited with error code 1
Consider creating an issue using the following link: https://github.com/tuist/tuist/issues/new/choose
Resolved cache profile 'Development' from Tuist's defaults
FirebaseCrashlytics
is not a valid configured external dependency for platform ios
Consider creating an issue using the following link: https://github.com/tuist/tuist/issues/new/choose`
I switched to 1.4.6 and have same problem
When I build the example project I get the following error:
error: Mint does not exist
Привет, спасибо вам за фреймворк, отличное решение, но возник один вопрос:
Можно ли получить ссылку на UIViewController до его показа? Пока не нашел как это можно сделать.
Привет. Как через нивелир можно достать TabBar и открыть на нем второй таб?
topCotainer у меня RootViewController.
Пытаюсь найти TabBar через container, но он его не видит.
Мой код:
navigator.navigate { route in
route
.first(.tabs)
.selectTab(of: UINavigationController.self, with: .index(1))
.makeVisible()
}
Hey! Thanks for an amazing library, you did a tremendous job!
IMO Nivelir has one of the most well-designed APIs I've come across as an Apple platforms developer, especially given the amount of complexities it hides. Abstractions are well-thought and on-point. 🤌
I am considering to use Nivelir for my next project, because I found myself solving the same problems when doing the complex global routing, but one thing I am concerned about is tight coupling between ViewControllers/Views and Navigation by invoking navigation actions directly from ViewControllers/Views. Basically the problem that Coordinator pattern is intended to solve.
I do understand that this library is not opinionated about where to invoke navigation actions (which it makes it even more cool) and it can perfectly be abstracted and delegated away to Coordinator or other assisting entities.
The question is – what is your take on it? How are you dealing with your Presentation Layer (VC/View) "knowing too much" about Navigation? Or you simply don't focus on it and it works fine for you and you don't overstretch with abstractions here by introducing something like Coordinators?
Thanks!
Hi guys
I have reviewed some code samples, and it appears that Nivelir is a good solution for projects based on UIKit. The partial Swift UI support is an additional feature rather than the main goal of the framework.
Thank you
Hi! Thanks for lib!
How can I get first/last route in stack?
Hierarchy
TabBar VC with 3 tabs -> Navigation VC with pushed view controllers ()
Code
return route
.first(.tabs)
.selectedTab
.last(.stack)
.??Need to get first or last screen in Navigation VC stack??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.