Post

Replies

Boosts

Views

Activity

Reply to AppDelegate can be nil?
I actually ran into an example of UIApplication.shared.delegate being nil today. During the init of your app delegate, UIApplication.shared.delegate is nil. So if something needs to access the app delegate immediately after super.init() there's a possibility its still nil. For me, I populated my dependency root for dependency injection here. I added a line of code to one of my services that needed to access the app delegate and it was nil. Other than this, I can't think of any other possible times that it would be nil.
Nov ’20