【问题标题】:Open the VC by pressing a button from the XIB通过按下 XIB 中的按钮打开 VC
【发布时间】:2017-11-05 10:49:58
【问题描述】:

请帮帮我。 有一个带有标记的地图,点击它们会弹出一个XIB = UIVIew,里面有一个按钮,你需要点击按钮打开viewController

【问题讨论】:

  • 您是否为此使用 Google Maps SDK?
  • 不,我使用的是苹果地图

标签: swift xib viewcontroller


【解决方案1】:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "MarkerVC")
self.navigationController?.pushViewController(vc, animated: true)

【讨论】:

  • 让您印象深刻的是,您知道要问什么。
【解决方案2】:
let viewController = YourViewController(nibName: "YourViewController", bundle: nil)
self.present(viewController, animated: true, completion: nil)

如果 VC 来自 XIB,请使用上述。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-11
    • 1970-01-01
    相关资源
    最近更新 更多