VBRRollingPit icon indicating copy to clipboard operation
VBRRollingPit copied to clipboard

Using it programmatically

Open ordinaryman09 opened this issue 5 years ago • 2 comments

How can I use this programmatically?

I tried overriding the uitabbar on uitabbarcontroller but it doesnt show the tabbar

class CustomTabbarController:UITabBarController {
    
    override var tabBar: RollingPitTabBar {
        let tabbar = RollingPitTabBar(frame: CGRect(x: 0, y: 0, width: 414, height: 49))
        tabbar.delegate = self
        return tabbar
    }
}

ordinaryman09 avatar Mar 07 '19 15:03 ordinaryman09

Sorry for the late answer! 1.: Could you move the instantiation of your tabbar to the init function of your TabBarController? 2.: Could you call self.view.addSubview(tabbar) after you initialised the tabbar?

something like this:

    let myTabBar :RollingPitTabBar
    
    public required init?(coder aDecoder: NSCoder) {
        self.myTabBar = RollingPitTabBar(frame: CGRect(x: 100, y: 0, width: 414, height: 300))
        super.init(coder: aDecoder)
        self.view.addSubview(tabBar)
        self.myTabBar.delegate = self
    }
    
    override var tabBar: UITabBar {
        return myTabBar
    }

I haven't tested it, so looking forward to your feedback.

v-braun avatar Mar 17 '19 17:03 v-braun

will close this because of inactivity in a month, if u need still help please let me know

v-braun avatar Apr 21 '20 08:04 v-braun