Application Lifecycle
App states, AppDelegate, SceneDelegate, background modes, app termination
1What is UIApplicationDelegate?
What is UIApplicationDelegate?
Respuesta
UIApplicationDelegate is a protocol that defines callback methods for the application lifecycle. It enables responding to important events such as launch, backgrounding, or foreground transition. Every iOS application must implement this protocol in its AppDelegate class to manage its lifecycle correctly. It's the central point for initializing third-party services, configuring notifications, and managing global state transitions. Since iOS 13, this protocol shares responsibilities with SceneDelegate for managing multiple windows.
2When is the application(_:didFinishLaunchingWithOptions:) method called?
When is the application(_:didFinishLaunchingWithOptions:) method called?
Respuesta
This method is called when the application launches, after UIApplication initialization and before the UI is displayed. It's ideal for initializing third-party services, configuring the database, registering for notifications, and setting up global parameters. Long operations should be avoided as they delay the initial display.
3What are the main states in the iOS application lifecycle?
What are the main states in the iOS application lifecycle?
Respuesta
The lifecycle has five main states: Not Running (app not launched or terminated), Inactive (app in foreground but not receiving events, temporary interruptions), Active (app running normally and receiving events), Background (app executing in background with ~30 seconds before suspension), and Suspended (app frozen in memory, no execution). Understanding these states enables proper resource management, permissions handling, and battery optimization. Transitions between these states trigger AppDelegate or SceneDelegate methods.
What is the difference between applicationWillResignActive and applicationDidEnterBackground?
What is the role of applicationDidBecomeActive?
+17 preguntas de entrevista
Otros temas de entrevista iOS
Swift Basics
Swift Language Essentials
UIKit Fundamentals
UIViewController Lifecycle
UserDefaults & Keychain
Auto Layout & Constraints
UITableView & UICollectionView
SwiftUI Basics
SwiftUI State Management
SwiftUI Navigation
Networking & URLSession
Codable & JSON Parsing
Core Data
Protocol Oriented Programming
MVVM Architecture
Push Notifications
Unit Testing & XCTest
UI Testing
Xcode & Build System
Swift Package Manager
Memory Management & ARC
Combine Framework
Concurrency & async/await
iOS Design Patterns
Performance Optimization
Security & Encryption
SwiftUI Advanced
iOS Application Architecture
Domina iOS para tu próxima entrevista
Accede a todas las preguntas, flashcards, tests técnicos, ejercicios de code review y simuladores de entrevista.
Empieza gratis