Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using it programmatically #11

Open
ordinaryman09 opened this issue Mar 7, 2019 · 2 comments
Open

Using it programmatically #11

ordinaryman09 opened this issue Mar 7, 2019 · 2 comments
Assignees

Comments

@ordinaryman09
Copy link

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
    }
}
@v-braun v-braun self-assigned this Mar 8, 2019
@v-braun
Copy link
Owner

v-braun commented Mar 17, 2019

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
Copy link
Owner

v-braun commented Apr 21, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants