Code Monkey home page Code Monkey logo

Comments (6)

taimur avatar taimur commented on August 21, 2024 2

Thank you so much - Highly appreciate your efforts. You are a genius 👍

from urlnavigator.

devxoul avatar devxoul commented on August 21, 2024

I think this is possibly duplicated with #4. If you don't think so, could you please share your code? Thanks!

from urlnavigator.

taimur avatar taimur commented on August 21, 2024

@devxoul Thanks a lot - you were absolutely Right - That issue is solved.
Can you please guide me on this one too.

In the NavigationMap when I map my view controllers - I receive this error

Navigator.map("navigator://motors/<vehicleName>", MotorViewController.self)

Cannot convert value of type 'MotorViewController.Type' to expected argument type 'URLNavigator.URLOpenHandler' (aka '(URLConvertible, Dictionary<String, Any>) -> Bool')

from urlnavigator.

devxoul avatar devxoul commented on August 21, 2024

@taimur glad to hear that! Does MotorViewController conform to protocol URLNavigable?

from urlnavigator.

taimur avatar taimur commented on August 21, 2024

Yeah MotorViewController conforms to URLNavigable.
Thats the code of the whole class

import UIKit
import URLNavigator

class MotorViewController: UIViewController {

  let vehiclename: String
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
  
  init(vehiclename: String) {
    self.vehiclename = vehiclename
    super.init(nibName: nil, bundle: nil)
    self.title = "\(vehiclename)"
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
  
  
  required convenience init?(URL: URLConvertible, values: [String : AnyObject]) {
    guard let vehicle = values["vehicle"] as? String else {
      return nil
    }
    self.init(vehiclename: vehicle)
  }
  
  
}


from urlnavigator.

devxoul avatar devxoul commented on August 21, 2024

Could you please try with the code below?

- class MotorViewController: UIViewController {
+ class MotorViewController: UIViewController, URLNavigable {

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.