Storyboards should provide support for "external objects".
| Originator: | oliver | ||
| Number: | rdar://27213719 | Date Originated: | 2016-07-07 |
| Status: | Open | Resolved: | |
| Product: | macOS SDK | Product Version: | |
| Classification: | Enhancement | Reproducible: | N/A |
Summary: In XIB files it is possible to add an External Object when loading a NIB using instantiateWithOwner:topLevelObjects: This is not possible in an NSStoryboard (or a UIStoryboard for that matter). This would be useful, for example, to enable a developer to supply singleton style objects to storyboard view controllers. One example of this might be a NSDocumentController. "Fortunately" in the case of NSDocumentController the 2nd invocation of init returns a shared instance so you can fake this in a storyboard by putting an NSObject (of type NSDocumentController) in a storyboard "scene". However this behaviour, although documented, is quite weird and a better architecture would be to allow storyboards to supply external objects to scenes via some form of dependency injection that could be referenced in the storyboard. Steps to Reproduce: N/A Expected Results: That Storyboards should support external top level objects. Actual Results: You can not supply external top level objects to a storyboard. Version: Xcode Version 7.3.1 (7D1014), macOS X 10.11.5 (15F34) Notes: Configuration: Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!