Code Monkey home page Code Monkey logo

Comments (6)

devxoul avatar devxoul commented on August 21, 2024

@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.

 avatar commented on August 21, 2024

@devxoul thanks for your reply. I think this would be a workaround.

from urlnavigator.

SeongBrave avatar SeongBrave commented on August 21, 2024

in storyboard can use Navigator.pushURL() or Navigator.presentURL() ?because i am not sure use which one

from urlnavigator.

devxoul avatar devxoul commented on August 21, 2024

@SeongBrave, I'm not sure what did you mean :)

from urlnavigator.

SeongBrave avatar SeongBrave commented on August 21, 2024

@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.

devxoul avatar devxoul commented on August 21, 2024

@SeongBrave, yeah, that is the limitation of current version :(

from urlnavigator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.