Я пытаюсь настроить панель вкладок так, чтобы каждый элемент имел закругленные углы, как на картинке выше. На данный момент я создал панель вкладок с правильным цветом фона, а также добавил изображение к каждому вкладку.
let tabBarController = UITabBarController()
let settingStoryboard = UIStoryboard(name: "Setting", bundle: nil)
let toDoListStoryboard = UIStoryboard(name: "ToDoList", bundle: nil)
let homeStoryboard = UIStoryboard(name: "Home", bundle: nil)
let eventListStoryboard = UIStoryboard(name: "EventList", bundle: nil)
let activityStoryboard = UIStoryboard(name: "Activity", bundle: nil)
let settingVC = settingStoryboard.instantiateViewController(withIdentifier: "Setting") as! SettingViewController
let toDoListVC = toDoListStoryboard.instantiateViewController(withIdentifier: "ToDoList") as! ToDoListViewController
let homeVC = homeStoryboard.instantiateViewController(withIdentifier: "Home") as! HomeViewController
let eventListVC = eventListStoryboard.instantiateViewController(withIdentifier: "EventList") as! EventListViewController
let activityVC = activityStoryboard.instantiateViewController(withIdentifier: "Activity") as! ActivityViewController
let vcData: [(UIViewController, UIImage)] = [
(settingVC, UIImage(named: "SettingIcon")!),
(toDoListVC, UIImage(named: "ToDoIcon")!),
(homeVC, UIImage(named: "HomeIcon")!),
(eventListVC, UIImage(named: "EventIcon")!),
(activityVC, UIImage(named: "ActivityIcon")!)
]
let vcs = vcData.map { (vc, image) -> UINavigationController in
let nav = UINavigationController(rootViewController: vc)
nav.tabBarItem.image = image
return nav
}
tabBarController.viewControllers = vcs
tabBarController.tabBar.isTranslucent = true
tabBarController.tabBar.barTintColor = UIColor(red: 19/255, green: 41/255, blue: 77/255, alpha: 1)
window?.rootViewController = tabBarController