uistoryboardsegue - Swift: programmatically enumerate outgoing segues from a UIVIewController -
i want list outgoing segues uiviewcontroller, described in programmatically enumerate outgoing segues uiviewcontroller, in swift. (swift 2, xcode 7, ios8+).
i can do
override func viewdidload() { super.viewdidload() let s = valueforkey("storyboardseguetemplates") print("switchingvc: segues: \(s)") } and produces output like
switchingvc: segues: optional(( "<uistoryboardpresentationseguetemplate: 0x1754a130>", "<uistoryboardpresentationseguetemplate: 0x17534f60>", "<uistoryboardpresentationseguetemplate: 0x17534fc0>" )) but struggle produce after that. can't find definition of uistoryboardpresentationseguetemplate. how can persuade swift tell me what's inside it? how can find segue identifier?
thanks!
this valueforkey("storyboardseguetemplates") undocumented property , uistoryboardpresentationseguetemplate undocumented class. beware of rejection app store if uploading application app store.
if want use in in-house projects, use following
for template in (valueforkey("storyboardseguetemplates") as? [anyobject])! { if let identifier = template.valueforkey("identifier") as? string { print("identifier - " + identifier) } else { print("no identifier \(template)") } }
Comments
Post a Comment