Comments (6)
@WPPD, It's not available at this time. You should initialize your view controller programmatically.
However, you can map the closure to instantiate and push view controller from Storyboard. For example:
self.navigator.map("myapp://post/<int:id>") { URL, values in
guard let postID = values["id"] as? Int else {
return false
}
let postViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
Navigator.push(postViewController)
return true
}
Then use Navigator.openURL()
instead of Navigator.pushURL()
:
Navigator.openURL("myapp://post/12345")
from urlnavigator.
@devxoul thanks for your reply. I think this would be a workaround.
from urlnavigator.
in storyboard can use Navigator.pushURL() or Navigator.presentURL() ?because i am not sure use which one
from urlnavigator.
@SeongBrave, I'm not sure what did you mean :)
from urlnavigator.
@devxoul when I use 'Navigator.map("myapp://user/int:id", UserViewController.self)' type, I can Navigator.push("myapp://user/123") or Navigator.present("myapp://user/123")
but when I use storyboard , I set
self.navigator.map("myapp://post/<int:id>") { URL, values in
guard let postID = values["id"] as? Int else {
return false
}
let postViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
Navigator.push(postViewController)
return true
}
I only use
Navigator.openURL("myapp://post/12345")
this mean Navigator.pushURL(myapp://post/12345)
but not can
Navigator.presentURL(myapp://post/12345)
I am sorry for My poor English level
from urlnavigator.
@SeongBrave, yeah, that is the limitation of current version :(
from urlnavigator.
Related Issues (20)
- 【iOS 13】present model issues HOT 3
- Please release latest version!
- Hi, I have a extension for URLNavigator, should add a link in this repo?
- Can you add a singleton for Navigator?
- URL contain #
- 获取rootViewController发生错误的问题 HOT 1
- A very small question that really matters to me
- 如果主控制器有子控制器,子控制器没有加到父控制器 获取不到 navigationcontroller HOT 2
- New Release request
- how to get a viewController, no push
- iOS14.2 push failed HOT 1
- demo 的类型还没更改过来
- 路由无法获取的bug
- demo运行不起来啊
- Pass multiple parameters, and the URL after the concatenation of multiple parameters
- Topmost does not return the right UIViewController
- Can I use in oc?
- xcode15+ios17beta cannot adapt with https or http pattern HOT 8
- topMost extension method should support UISplitViewController
- In iOS 17 ,"https://<path:_>" convert to URL failured HOT 3
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 urlnavigator.