我有一个从UITabBarController
子类化的简单视图控制器。在将项目分配给标签栏控制器时,我遇到了UITabBarItem
class LandingVC: UITabBarController, UITabBarControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
let storyboard = UIStoryboard(name: "Ssettings", bundle: nil)
let vc1 = storyboard.instantiateViewController(withIdentifier: "bookID")
let tab1 = UITabBarItem(title: "Föo", image: nil, selectedImage: nil)
vc1.tabBarItem = tab1
let vc2 = storyboard.instantiateViewController(withIdentifier: "SettingsID")
let tab2 = UITabBarItem(title: "Sök", image: nil, selectedImage: nil)
vc2.tabBarItem = tab2
self.viewControllers = [vc1, vc2]
}
}
但是奇怪的是,标签栏控制器显示标题为Sok
和Foo
的项目而忽略了瑞典语字符。甚至选项卡的systemItem似乎也失败了,我们将不胜感激