App lifecycle and scene management

iOS 13 introduced scene-based lifecycle for multi-window support on iPad. The App and Scene delegates handle different lifecycle events. SceneDelegate manages individual scenes—windows on iPad or the single window on iPhone. It responds to state trans

Accessibility with VoiceOver support

Accessible iOS apps work for all users, including those with disabilities. VoiceOver reads UI elements, requiring proper labels and hints. I set .accessibilityLabel() for non-text elements like images and buttons, describing what they represent. .acce

SwiftUI animations and transitions

SwiftUI makes animations declarative and automatic. The .animation() modifier animates state changes with built-in curves like .easeInOut, .spring(), or custom timing. Explicit animations use withAnimation {} blocks to scope which changes animate. Tra

Coordinator pattern for navigation flow

The Coordinator pattern separates navigation logic from view controllers, promoting reusability and testability. Coordinators own navigation controllers and decide which screens to show based on user actions. Each flow (onboarding, main, settings) has

Push notifications with UserNotifications framework

Push notifications re-engage users with timely content. I use the UserNotifications framework to request authorization and handle notification delivery. The app must register for remote notifications and send the device token to the backend. When noti

Image caching with NSCache and async loading

Loading images from URLs requires caching to avoid redundant network calls and improve performance. I create an image cache using NSCache which automatically evicts objects under memory pressure. The cache stores UIImage or Data keyed by URL. For asyn

Navigation patterns with NavigationStack

SwiftUI's NavigationStack introduced in iOS 16 provides programmatic navigation with type-safe paths. I use NavigationPath to manage navigation state, enabling deep linking and state restoration. The navigationDestination modifier maps path values to

Keychain wrapper for secure credential storage

The Keychain securely stores sensitive data like passwords and tokens, encrypting them at the OS level. Direct Keychain APIs are verbose, so I create a wrapper class that simplifies common operations. The wrapper uses Security framework's SecItemAdd,

SwiftUI List with pull-to-refresh and infinite scroll

Lists are fundamental to iOS apps, displaying scrollable collections efficiently. SwiftUI's List or ScrollView with LazyVStack renders items on-demand. I add pull-to-refresh with the .refreshable modifier, calling async refresh logic. For infinite scr

Unit testing with XCTest and mocks

Unit tests verify code behavior in isolation using XCTest framework. I create test classes inheriting from XCTestCase with test prefixed methods. Each test has arrange-act-assert structure: set up dependencies, execute code, verify results with XCTAss

Custom SwiftUI view modifiers for reusability

View modifiers encapsulate reusable styling and behavior in SwiftUI. Creating custom modifiers keeps views clean and promotes consistency. I define modifiers by conforming to the ViewModifier protocol, implementing body(content:) that transforms the c

URLSession networking with async/await

Modern Swift networking uses async/await for cleaner asynchronous code compared to completion handlers. URLSession's async methods like data(from:) make network calls straightforward. I wrap API calls in a service layer with typed responses using Coda