我想列出一个UIViewController中的传出转场,就像Programmatically enumerate outgoing Segues for a UIViewController 中所描述的那样,但这次需要用Swift实现。(Swift 2、Xcode 7、iOS8+)。
我可以做到:
并且它会生成像下面这样的输出。
我可以做到:
override func viewDidLoad() {
super.viewDidLoad()
let s = valueForKey("storyboardSegueTemplates")
print("switchingVC: segues: \(s)")
}
并且它会生成像下面这样的输出。
switchingVC: segues: Optional((
"<UIStoryboardPresentationSegueTemplate: 0x1754a130>",
"<UIStoryboardPresentationSegueTemplate: 0x17534f60>",
"<UIStoryboardPresentationSegueTemplate: 0x17534fc0>"
))
但是我在那之后很难产生任何东西。我找不到 UIStoryboardPresentationSegueTemplate
的任何定义。我该如何说服 Swift 告诉我它内部的内容?我该如何找到 segue 的 identifier
?
谢谢!