Search code examples
iosswiftipados

CoreLocation location permission dialog not displayed when in split screen


Here is the simplified version of my code:

import UIKit
import CoreLocation

class ViewController: UIViewController {

  override func viewDidAppear() {
    super.viewDidAppear()

    let locationManager = CLLocationManager()
    locationManager.delegate = self
    locationManager.requestWhenInUseAuthorization()
  }
}

extension ViewController: CLLocationManagerDelegate {}

When launched, I expect this code to display the location permission dialog. I've added the NSLocationWhenInUseUsageDescription key into Info.plist file already.

This code works correctly when the application runs in full screen. However, when launched in split screen the dialog never appears.

I couldn't find anybody else battling this problem except for this forum: https://developer.apple.com/forums/thread/686064 which didn't come to any conclusion.

I thought it may be the OS limitation, but Google seem to have figured it out: enter image description here

Any ideas?


Solution

  • I had a confirmation from Apple that this is an operating system level bug. There is no known workaround. It has been fixed in iOS 16.0