Sample code demonstrating Learn how to access your app's App Delegate from anywhere in your Swift code, including from SwiftUI views..
This project accompanies the article: How to Access the App Delegate in Swift
- Xcode 26.2+
- iOS 13.0+
- Swift 6.0
- Clone this repository
- Run
xcodegen generate(requires XcodeGen) - Open
AccessAppDelegateSwift.xcodeproj - Build and run
- Examples.swift: Example code
- ContentView.swift: ContentView
- MyApp.swift: MyApp, DataView, AppDelegate, MyApp, DataView
Read the full article at BleepingSwift for detailed explanations and additional examples.
MIT License - see LICENSE for details.