I am building a Swift Playgrounds App project on iPad running iPadOS 26.0.1 using the latest version of Swift Playgrounds. I need to access Core Location for a plant location logging app. What I have done: • Created an App project (not a Playground) in Swift Playgrounds • Enabled ‘Core Location When in Use’ in the app capabilities (accessed by tapping the app name) • Implemented a CLLocationManager with CLLocationManagerDelegate • Called manager.requestWhenInUseAuthorization() from .onAppear in a SwiftUI view • Called manager.startUpdatingLocation() immediately after The problem: The location permission prompt never appears when the app runs. The app does not appear in Settings → Privacy & Security → Location Services at all. There are no error messages or crashes — the app simply never requests location access. What I have ruled out: • The capability IS enabled in Swift Playgrounds app settings • The app runs without errors otherwise • This is an App project, not a classic Playground, so it should support capabilities Questions: 1. Is CLLocationManager with requestWhenInUseAuthorization() supported in Swift Playgrounds App projects on iPadOS 26? 2. Has the location authorization API changed in iPadOS 26 in a way that affects Swift Playgrounds? 3. Is there a working code example for Core Location in a Swift Playgrounds App project on iPadOS 26? Any guidance would be greatly appreciated.
Solved! Thank you to everyone who responded.
The issue: The location permission prompt never appeared when requestWhenInUseAuthorization() was called from within a SwiftUI sheet (modal view). iOS silently ignores permission requests made from inside sheets.
The fix: Move the permission request to the parent view’s .onAppear modifier — before any sheet is presented. The LocationManager is created as a @StateObject in the main ContentView, requestPermission() is called in ContentView.onAppear, and the LocationManager instance is passed into the sheet view as an @ObservedObject.
Key points:
• The Core Location When in Use capability must be enabled in Swift Playgrounds app settings
• Use @StateObject in the parent view, @ObservedObject in the sheet
• Call requestWhenInUseAuthorization() from the main view, not from inside a sheet
• startUpdatingLocation() can still be called from within the sheet’s .onAppear
Hope this helps someone else!