Ramotion / animated-tab-bar

:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion
https://www.ramotion.com/animated-tab-bar-ios-app-development-ui-library/
MIT License
11.12k stars 1.33k forks source link

Maqueta de RAMAnimatedTabBarController programatically #25

Closed arden closed 8 years ago

arden commented 9 years ago

i'm want to create a RAMAnimatedTabBarController programatically, there have some examples?

ed-mejia commented 8 years ago

Hi, just create something like this:

class MyTabBarController: RAMAnimatedTabBarController {

    override func viewDidLoad() {

        // create here your controllers, or override your init and pass them as parameters
        let ViewController1 = UIViewController()
        let oneNavigationController = UINavigationController(rootViewController: ViewController1)
        let tbItema = RAMAnimatedTabBarItem(
            title: "VIEW1",
            image: UIImage(named: "icon1"),
            selectedImage: UIImage(named: "icon1")
        )
        tbItema.animation = RAMBounceAnimation()
        oneNavigationController.tabBarItem = tbItema

        let ViewController2 = UIViewController()
        let twoNavigationController = UINavigationController(rootViewController: ViewController2)
        let tbItema = RAMAnimatedTabBarItem(
            title: "VIEW2",
            image: UIImage(named: "icon1"),
            selectedImage: UIImage(named: "icon1")
        )
        tbItemb.animation = RAMBounceAnimation()
        twoNavigationController.tabBarItem = tbItemb

        self.viewControllers = [oneNavigationController, twoNavigationController]

        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }   
}

Also Im not sure but I think you need to go to RAMAnimatedTabBarItem and delete IBOutlet and IBInspectable.

krab9522 commented 7 years ago

Tank you very match! It work fine!