I have a custom Tab Bar class. It is shown below. In main.storyboard, I set the class of my tab bar to be CustomTabBar:
class CustomTabBar: UITabBar {
override var items: [UITabBarItem]? //[This line returns an error]
// items?[0].selectedImage = UIImage(named: "MyImage.png")
override func sizeThatFits(_ size: CGSize) -> CGSize {
var size = super.sizeThatFits(size)
size.height = 49.0
return size
}
}
The line "override var items" returns the error "Cannot override with a stored property 'items'." I want to access this property so that I can change associated with the first tab bar item. I want to be able to use the line that is currently commented out below that line. How come I get this error? Also, is there another way to accomplish what I want to do?