Я пытался удалить построчно, но в конце создал новый тестовый проект, просто чтобы воспроизвести ошибку с помощью нескольких строк кода.
ParentViewController.swift
Код: Выделить всё
import UIKit
class ParentViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Left", style: .plain, target: nil, action: nil)
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Right", style: .plain, target: nil, action: nil)
self.navigationController?.navigationBar.backgroundColor = .orange
let ubtton = UIButton()
ubtton.frame = self.view.bounds
ubtton.setTitle("PRESENT", for: .normal)
ubtton.setTitleColor(.gray, for: .normal)
ubtton.addTarget(self, action: #selector(showTestController), for: .touchUpInside)
self.view.addSubview(ubtton)
}
@objc
func showTestController() {
let viewController = PresentedViewController()
viewController.modalPresentationStyle = .fullScreen
let navigationController = UINavigationController(rootViewController: viewController)
navigationController.modalPresentationStyle = .fullScreen
self.present(navigationController, animated: true)
}
}
Код: Выделить всё
import UIKit
class PresentedViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .red
// Do any additional setup after loading the view.
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Close", style: .plain, target: self, action: #selector(close))
}
@objc func close() {
self.dismiss(animated: true)
}
override var prefersStatusBarHidden: Bool {
return true
}
}
Примечание: я запускаю его в симуляторе с Xcode 26 beta 6 и думаю, что симуляторы работают в iPadOS 26 beta 6, а не в 8.

Подробнее здесь: https://stackoverflow.com/questions/797 ... ter-presen
Мобильная версия