I need to use a subclass of the UITabBar for my project because of the following problem Why page Push animation Tabbar moving up in the iPhone X.
I do not use stor
The reason you're getting the 'customTabBar.Type'
error is because you're returning the name of your class which, against normal convention, is camel cased. You want to be returning an object - an instance of your class - instead.
import UIKit
@objc class customTabBarController: UITabBarController {
let myCustomTabBar = customTabBar() // If we're writing conventional swift,
// this should be CustomTabBar()
override var tabBar: UITabBar {
// Because your class name is customTabBar instead of CustomTabBar,
// this is returning a TYPE instead of an OBJECT
// return customTabBar
// If you wanted to return a new version of a tab bar on every
// get of this object, you'd use the following code which is similar to yours:
// return customTabBar()
// More likely, you want to return the SAME tabBar throughout this object's
// lifecycle.
return myCustomTabBar
}
}