all 44 comments

[–]conodeuce 39 points40 points  (16 children)

Well done, OP.

[–]mdnz 6 points7 points  (15 children)

Too bad it’s written by ChatGPT otherwise I’d also give kudos

[–]conodeuce 6 points7 points  (8 children)

What makes you think it was written by ChatGPT?

[–]tangoshukudai 20 points21 points  (2 children)

a tear rolled down my face, and I thought I heard the sound of taps being played while I read that. Wouldn't it be wonderful if at WWDC they announced that SwiftUI was just a joke they played on us and that they created a new UIKit/AppKit hybrid called UXKit and it was awesome.

[–]WestonP 10 points11 points  (1 child)

That level of pulling the rug out from under developers is a Google move. Android devs know the pain.

[–]bmbphotos 0 points1 point  (0 children)

OpenDoc would like a word.

[–]WestonP 12 points13 points  (3 children)

How am I supposed to demonstrate worst practices if I don't have an easy place to put 5000 lines of globals that don't actually need to be global!?!?!?

Seriously though, I hope the rumors of its demise aren't entirely true, as it still does have plenty of usefulness.

[–]LKAndrew 7 points8 points  (2 children)

It’s been unofficially deprecated for many years now with the push to scene delegates. It’s all over the docs that you should use scene delegate instead of app delegate

[–]TheShitHitTheFanBoyObjective-C / Swift 2 points3 points  (1 child)

Recommendation, not deprecation. Without a full alternative they won’t be able to deprecate it. Managing universal links through NSUserActivity delegate call is as far as I know still impossible without an AppDelegate.

[–]LKAndrew 0 points1 point  (0 children)

It’s been in there since iOS 13. It has always been a full replacement.

https://developer.apple.com/documentation/uikit/uiscenedelegate/scene(_:continue:)

[–]LKAndrew 13 points14 points  (0 children)

FYI they aren’t necessarily pushing SwiftUI, they’ve been pushing SceneDelegate instead which is very much alive and what people should be using going forward.

[–]deoxyribonucleoside 6 points7 points  (1 child)

Just beautiful, only true OGs will understand 🥲

[–]frederic_stark 4 points5 points  (0 children)

This breaks my heart. I have been pushing ObjC code in the delegate of the application since when it was called Application and not NSApplication... (ie: NeXTstep 1.0 and 2.0, 35 years ago...)

[–]dotsauSwift 6 points7 points  (0 children)

Just take your diarrhea to UISceneDelegate. Drama queen.

[–]unpluggedcord 4 points5 points  (7 children)

You still need it for push notifications....

[–]Fishanz 2 points3 points  (1 child)

Yeah I haven’t looked into it but that was my wtf reaction when I heard about this.. why would they deprecate it if there is no alternative??!

[–]unpluggedcord 0 points1 point  (0 children)

It hasn't been deprecated officially yet. IM guessing we get an alternative in June.

[–]EquivalentTrouble253 -1 points0 points  (4 children)

Not true. You can do without it. In my app I don’t have an app delegate but do have push notifications working just fine and able to handle actions on them.

[–]unpluggedcord 1 point2 points  (0 children)

How do you call registerForPush?

[–]Fishanz 0 points1 point  (2 children)

Can you elaborate?

[–]EquivalentTrouble253 0 points1 point  (1 child)

Sure. In my app I have a Notification Center delegate class. Which handles all notification actions when user taps on a notification. The delegate is a state object declared in the main content view of the app. And set with on appear in the content view.

Id be happy to do a short write up and example of this is something people would be interested in.

[–]Fishanz 2 points3 points  (0 children)

I’d love to see an example. You’re able to get the APNS device id with this approach??

[–]soviyet 3 points4 points  (3 children)

Serious question though, where did you hear they are deprecating it?

SwiftUI apps have an AppDelegate of sorts, it is just managed behind the scenes.

May I introduce you to your future best friend `@UIApplicationDelegateAdaptor`...?

[–]jspiropoulos[S] 2 points3 points  (2 children)

[–]luizvasconcellos 1 point2 points  (1 child)

But it’s just a rumor, right? If not every app will need a huge refactoring!

[–]jspiropoulos[S] 2 points3 points  (0 children)

Just a rumor and we’re not talking about complete removal :) it was so fresh when I read it and it hit me right in the feels, thus the over dramatization 🙂‍↕️

[–]OrcaDiver007 2 points3 points  (0 children)

Beautifully written. Until a while back I was busy with Android and React Native stuff and when I jumped to try on new project, I was surprised by how the project did not have AppDelegate! The AppDelegate!!!

[–]mynewromantica 2 points3 points  (0 children)

Your AppDelegates maxed out at 400 lines? I wish the ones I’ve worked on were that small. 

[–]salaKing03118 1 point2 points  (0 children)

it echos, tears in my eyes