navigationItem.title does not display on the first view controller in the new UITabBarController on iPad. Also, if I set navigationItem.titleMenuProvider an empty space is displayed. Everything displays as expected if it isn’t the first view controller.
let tabBarController = UITabBarController(tabs: [
UITab(title: "Tab 1", image: nil, identifier: "tab1", viewControllerProvider: { _ in
return UINavigationController(rootViewController: ViewController())
})
])
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.title = "First"
navigationItem.titleMenuProvider = { suggestions in
return UIMenu(children: [
UIAction(title: "Option 1", handler: { _ in
self.navigationController?.pushViewController(SecondViewController(), animated: true)
}),
UIAction(title: "Option 2", handler: { _ in })
])
}
}
}
class SecondViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.title = "Second"
navigationItem.titleMenuProvider = { suggestions in
return UIMenu(children: [
UIAction(title: "Option 1", handler: { _ in }),
UIAction(title: "Option 2", handler: { _ in })
])
}
}
}
Post
Replies
Boosts
Views
Activity
My project contains an asset catalog with images that have emojis in their name. When trying to build in Xcode 15.0 beta (15A5160n) and 'Generate Asset Symbols' enabled the compiler crashes.
Example error:
error: 'ï' is not a valid digit in integer literal
static let 0ï¸ â £Flat = ImageResource(name: "0ï¸ â £_flat", bundle: resourceBundle)