Has anyone else run into this issue? If you present a view controller and set its isModalInPresentation property to true, then when you try to drag down the view controller (which can't be dismissed), the view controller's content on the side of the vertical toolbar is shifted inward. This happens on a closed iPhone Duo. Even the title shifts if the vertical toolbar is on the left side.
To replicate, create a Swift/UIKit project. Edit the main storyboard by deleting the default view controller scene and add a navigation controller (and its default root view controller). Set the class for the root view controller to ViewController.
Then replace the default ViewController.swift code with the following:
import UIKit
class ViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
let modal = UIBarButtonItem(systemItem: .add, primaryAction: .init(handler: { _ in
let vc = ViewController()
vc.title = "Some Modal"
// If the following is true, dragging the modal view controller
// down results in the table margins being shifted on whichever
// side has a vertical toolbar. This happens on the iPhone Duo
// when closed in either portrait or landscape. Whichever side
// has the vertical toolbar gets shifted.
// When the iPhone Duo is open the modal appears in a form sheet
// and it does not demonstrate the issue.
// The navigation title is also affected when the iPhone Duo is
// closed and in landscape with the vertical toolbar on the left.
// If the following is false, dismissing the modal by dragging it
// down does NOT result in any change in the table's margins.
vc.isModalInPresentation = true // false
let nc = UINavigationController(rootViewController: vc)
self.present(nc, animated: true)
}))
navigationItem.rightBarButtonItem = modal
}
}
extension ViewController {
override func numberOfSections(in tableView: UITableView) -> Int { 2 }
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 4 }
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Some simple table cells to demonstrate the margin shift
let cell = tableView.dequeueReusableCell(withIdentifier: "cell") ?? UITableViewCell(style: .value1, reuseIdentifier: "cell")
cell.textLabel?.text = "Some Text"
cell.detailTextLabel?.text = "Value"
cell.accessoryType = .disclosureIndicator
return cell
}
}
Build and run the app with Xcode 27.1 and run it on an iPhone Duo (simulated or real). Tap the + icon to display the modal view controller (just another instance of ViewController). Now try to drag down the modal view controller. Notice the margin shift if the Duo is closed.
There is no margin shift is the Duo is open or if isModalInPresentation is set to false.
This has been reported as FB25221160.
0
0
14