CoreLocation location permission dialog not displayed when in split view

This is a cross-post from StackOverflow: https://stackoverflow.com/questions/73577615/corelocation-location-permission-dialog-not-displayed-when-in-split-view

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 view 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: https://i.stack.imgur.com/Gq4a5.jpg

Posting another question on the forum in the hopes that an Apple engineer or somebody who battled this problem before will across it.

Any ideas?

I battled this too, and lost; see this thread. (Takeaway: it’s a bug.)

You could mention my Feedback ID in your own bug report. It may help the  folks to keep track of duplicate reports on this.

CoreLocation location permission dialog not displayed when in split view
 
 
Q