Saagar Jha

(replying to cassie)
@porglezomp @hikari In case this wasn’t sarcasm what it actually does is everyone adds fatalError in init(coder:)

cassie

(replying to Saagar Jha)

@saagar @hikari oh I was thinking sincerely about the Swift-first classes that aren’t forced to inherit the ObjC soup

Jordan

(replying to cassie)

@porglezomp @saagar @hikari We have lost the magic of Good Interface Builder with Live View Objects in the style of the Steve Jobs Calculator Constructor (implemented with some truly wild object substitution shenanigans) but are still forced to carry “every AppKit and UIKit type claims to be NSCoding”.

2 replies →
2 replies

✾, chief troublemaker

(replying to Jordan)

@jrose @porglezomp @saagar @hikari having written that deprecation message, with 15 years of love in my heart, let me say: good riddance

✾, chief troublemaker

(replying to ✾, chief troublemaker)

@jrose @porglezomp @saagar @hikari but yeah, those conformances are forever

Saagar Jha

(replying to ✾, chief troublemaker)
@millenomi @jrose @porglezomp @hikari I have discovered that if you mark all your initializers as convenience inits it probably breaks something or the other but you don’t have to interact with NSCoding directly

✾, chief troublemaker

(replying to Saagar Jha)

@saagar @jrose @porglezomp @hikari yup, correct. It means that you are inheriting your designated initializer situation from your superclass, that is, you support using your superclass’s initializers to produce a fully functional object of _your_ subclass, and so the init(coder:) of your superclass is good enough for your subclass too.

The moment you add a designated init, the init(coder:) of your superclass isn’t sufficient anymore and you have to do both (if only to fatalErrror out).

Saagar Jha

(replying to ✾, chief troublemaker)
@millenomi @jrose @porglezomp @hikari Yeah so the lie here is that calling the superclass’s designated initializer is not actually going to provide a functional object because I do all that work in the convenience initializer

Kanbaru 🌟 (one hikari of too many)

(replying to Saagar Jha)

@saagar @millenomi @porglezomp @jrose btw interface builder can call init on your class if you prefer that to initWithCoder:, but I assume it can't connect outlets and stuff if you do (or can it 🤔)

1 replies →
1 replies

✾, chief troublemaker

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari @saagar @porglezomp @jrose it will set your outlets anyway. but why use IB at this point when SwiftUI is just so much better on every important level

Kanbaru 🌟 (one hikari of too many)

(replying to ✾, chief troublemaker)

@millenomi @saagar @porglezomp @jrose what if i am coding for 2008's best mobile operating system. what then

Kanbaru 🌟 (one hikari of too many)

(replying to Kanbaru 🌟 (one hikari of too many))

@saagar @millenomi @porglezomp @jrose or, of course, set up a frame for a view, so this has questionable utility for actual views

Saagar Jha

(replying to Kanbaru 🌟 (one hikari of too many))
@hikari @millenomi @porglezomp @jrose The best views are ones that are hardcoded to support exactly one size

Kanbaru 🌟 (one hikari of too many)

(replying to Saagar Jha)

@saagar @millenomi @porglezomp @jrose [UIButton buttonWithType:UIButtonTypeInfoLight] my beloved


Kanbaru 🌟 (one hikari of too many)

(replying to Jordan)

@jrose @porglezomp @saagar what do you mean by “claims to be” 😨

Kanbaru 🌟 (one hikari of too many)

(replying to Kanbaru 🌟 (one hikari of too many))

@jrose @porglezomp @saagar oh is this about how every UIView descendant must implement initWithCoder: itself

Saagar Jha

(replying to Kanbaru 🌟 (one hikari of too many))
@hikari @jrose @porglezomp Yes, except nobody does because Interface Builder is basically dead and buried at this point

Kanbaru 🌟 (one hikari of too many)

(replying to Saagar Jha)

@saagar @porglezomp @jrose it lives on in the hearts of all of us (and also in touchHLE because everyone used nib files 15 years ago)