Comments (9)
screensort://home
and screensort://home/share/1
is totally different. If you want to use such like /home/share/1
, you should use URL pattern such like screensort://home/share/<id>
.
from urlnavigator.
Cool, many thanks
from urlnavigator.
You have to map URLHandler
.
Navigator.map("myapp://tab/profile") { url, values in
let tabBarController = findTabBarController() // need your own method
tabBarController.selectedIndex = 1
}
Then use open()
.
Navigator.open("myapp://tab/profile")
from urlnavigator.
Thanks for your reply. Here is my code:
static func initialize() {
Navigator.map("screensort://home") { url, values in
let homeController = AppDelegate.shared().homeViewController
guard let action = values["action"] as? String else { return false}
guard let count = values["count"] as? Int else { return false}
homeController.openURLAction = action
homeController.openURLCount = count
homeController.fromURL = true
if homeController.openURLAction == "share" {
homeController.doShare()
} else if homeController.openURLAction == "delete" {
homeController.doDelete()
}
return true
}
}
My URL is myapp://home/share/1
But it does not work.
And I should put the map URLHandler
in func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {}
or in the NavigationMap.initialize()
?
from urlnavigator.
I had an another issue. And when the app is killed. I want to open it from openURL
, launch the rootViewController and call its function, but it crashed. How to debug?
from urlnavigator.
@hilen I couldn't understand.
from urlnavigator.
I mean I want to test the case that app is not running on the background. I open a URL like navigator://home/share
. The normal situation is that the app is launching and then call the methodfunc share()
. But now it crashed. I don't know how to debug. Cause I can't make a breakpoint.
from urlnavigator.
@hilen, http://stackoverflow.com/questions/18521276/ios-how-to-debug-freshly-launching-an-app-from-a-url could help you.
from urlnavigator.
I will have a look at it. Thanks. @devxoul
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 1
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.