[swift-evolution] Please remove obscure "!" requirements for implicitly unwrapped optionals
clattner at apple.com
Sat Dec 5 01:59:28 CST 2015
> On Dec 4, 2015, at 4:19 PM, Jon Shier <jon at jonshier.com> wrote:
> I can’t answer for Per, but, at least in my iOS and OS X programming, I often find myself creating IUOs in view controller to represent properties that I’m guaranteed to have set before viewDidLoad, but don’t want a custom initializer, due to the pain of multiple required init methods. So while my IUO usage is perfectly safe, they’re rather awkward to use.
> That said, I’d have to see a specific proposal to tell if it’s any better for my usage than IUOs.
Sure. For that use case, you’d be better served by a “delayed” property, which is initialized exactly once - but after init is done. There is some infrastructure that is missing to support that, but we’re interested in providing it.
More information about the swift-evolution