Essential Developer

View Original

How to crack the senior iOS dev interview and negotiate salary | Live Dev Mentoring

Watch on YouTube

Learn how to become a senior iOS developer, crack the senior interview, and negotiate salary.

Also, subscribe to our Youtube channel

Update/Correction

At ~47min we replaced @main with @UIApplicationMain, but that wasn't needed. We only had to remove the UISceneSession life-cycle methods from the AppDelegate to make it work.

Background:

On iOS 12 and before, we managed app life-cycle events through the UIApplicationDelegate. On iOS 13, Apple introduced the new UISceneDelegate APIs to respond to life-cycle events occurring within a scene.

New Xcode projects already come configured with an AppDelegate and a SceneDelegate. However, a requirement of this interview challenge was for the app to support iOS 12 and above (and iOS 12 doesn't support UISceneDelegate).

On iOS 12 and before, we had only the UIApplicationDelegate. So the project had duplication in the AppDelegate and SceneDelegate to be able to support both iOS 12 and 13+.

Since this app doesn't require managing scenes, our goal was to remove the UISceneDelegate and use only the UIApplicationDelegate, which works with iOS 12 and iOS 13+. This way, the code works with all iOS versions without duplication or doing more work than needed.

To remove the UISceneDelegate setup, we need to (1) remove the Application Scene Manifest entry from the Info.plist and (2) remove the UISceneSession life-cycle methods from the AppDelegate. And that's it!