Swift: programmatically enumerate outgoing segues from a UIVIewController

假如想象 提交于 2019-12-01 09:21:41

this valueForKey("storyboardSegueTemplates") is UNDOCUMENTED property and UIStoryboardPresentationSegueTemplate is UNDOCUMENTED class. Beware of rejection from App Store if you are uploading application to App Store.

If you want to use this in your in-house projects, use as following

for template in (valueForKey("storyboardSegueTemplates") as? [AnyObject])! {
    if let identifier = template.valueForKey("identifier") as? String {
        print("identifier - " + identifier)
    }
    else {
        print("no identifier for \(template)")
    }
}

Found from https://github.com/JaviSoto/iOS9-Runtime-Headers/blob/master/Frameworks/UIKit.framework/UIStoryboardSegueTemplate.h

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!