Comments (4)
If I'm understanding you correctly, Routable doesn't have an opinion how to do orchestrate multiple navigation controllers, it depends on your app.
for example, you can create a separate Routable
instance for each navigation controller. You could have some kind of block that configures all of them with the same routes, i.e.:
NSMutableArray *routers = [NSMutableArray new];
for (UINavigationController *navVc in @[nav1, nav2, nav3]) {
UPRouter *router = [Routable newRouter];
[router map: ...];
[routers addObject: router];
}
Or you could create one router, and only use map: toCallback:
, and that your callback you handle things like opening a certain tab, using a certain navigation controller, etc.
Let me know if that doesn't help
from routable-ios.
Hi, I applied your idea like:
[[Routable sharedRouter] map:@"routeToItemList2" toController:[ItemListPresenter class]];
[[Routable sharedRouter] map:@"itemList2" toCallback:^(NSDictionary *params) {
self.selectedIndex = 1;
[[Routable sharedRouter] setNavigationController:navigationControllerⅡ];
[[Routable sharedRouter] open:@"routeToItemList2"];
}];
[[Routable sharedRouter] open:@"itemList2"];
but it is not convenient.
There is a more perfect method?
from routable-ios.
Maybe we need a method like :
map: toController: Callback:
from routable-ios.
Simply call this delegate method can make it.
-(void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
UINavigationController *navigationConrollerModel = tabBarController.childViewControllers[tabBarController.selectedIndex];
[[Routable sharedRouter] setNavigationController:navigationConrollerModel];
}
from routable-ios.
Related Issues (20)
- routes should have the option to open as the root view controller HOT 1
- Undeclared selector warnings HOT 1
- Empty path components are ignored due to use of url.pathComponents HOT 1
- custom transitions HOT 1
- Example App has essential buttons hidden under nav bar
- Would Accent Correction be Considered? HOT 1
- User can pass in extra parameters when opening an url HOT 4
- Architecture question ...
- DeepLinking to Apps which are not Installed yet? HOT 1
- test_basicRouteWithEmptyComponents fails on iOS 8 HOT 5
- What if I wanna use both callback and view controller when mapping? HOT 2
- Are we able to pass url query parameters? HOT 1
- Any plans for an 0.1.2 release? HOT 3
- Multiple mappings do not consider each other HOT 4
- why not add a method just like 'map:(NSString *)format toController:(NSString *)controllerClass' HOT 1
- If I want to pop to return some of the data how to do HOT 1
- How to use in Swift
- Why not support tabBarController?
- can't support standard scheme URL ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from routable-ios.