A horizontal scrolling animation for iOS TabBarControllers
. Works with any number of TabBarItems
, and any orientation.
With three TabBarItems
:
-
Import
ScrollingTabBarUtils.swift
to your Xcode project -
Set your
UITabBarController
'sdelegate
toScrollingTabBarControllerDelegate
Ex:
class YourTabBarController: UITabBarController {
let delegate = ScrollingTabBarControllerDelegate() override func viewDidLoad() { super.viewDidLoad() self.delegate = delegate }
}
-
That's it!
The animation is provided by a call to UIView.animateWithDuration(_:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:)
, and the transition duration should be modified in transitionDuration(_:)
.
Feel free to modify these parameters.
MIT, see LICENSE for details.