View Controller Life Cycle

View Controller Life Cycle Methods init(coder)/init(nibName:bundle:): Called when the view controller is created programmatically or via Storyboard. loadView() Creates the view for the view controller (usually overridden if creating views manually). viewDidLoad() Called once when the view is loaded into memory. viewWillAppear() Called before the view appears on the screen …

Application Life Cycle

The app transitions through the following states in its life cycle: The application life cycle is managed by the AppDelegate and SceneDelegate. 1.application(_:didFinishLaunchingWithOptions:) 2.applicationDidBecomeActive(_:) 3.applicationWillResignActive(_:) 4.applicationDidEnterBackground(_:) Called when the app enters the background. 5.applicationWillEnterForeground(_:) Called as the app transitions from background to foreground. 6.applicationWillTerminate(_:) Called when the app is about …

Lazy Properties

A lazy property is a property whose initial value is not calculated until the first time it is accessed.

TypeAlias

A typealias is used to provide an alternative name for an existing type. It helps improve code readability, especially when working with complex or verbose types. It does not create a new type; it only creates a new name for an existing type.

Defer

defer is a statement used to execute a block of code just before the current scope e.g a function or loop exits.