An Android scrollable tab bar style container view controller
Copy & paste Source
folder to your project
use_frameworks!
pod 'SlidingContainerViewController'
Create a UIViewController
as container, setup your tab view controllers and implement SlidingContainerViewController
and add its view to view controller's view like:
let slidingContainerViewController = SlidingContainerViewController (
parent: self,
contentViewControllers: [vc1, vc2, vc3, vc4],
titles: ["First", "Second", "Third", "Forth"])
view.addSubview(slidingContainerViewController.view)
protocol SlidingContainerViewControllerDelegate {
func slidingContainerViewControllerDidMoveToViewController (slidingContainerViewController: SlidingContainerViewController, viewController: UIViewController, atIndex: Int)
func slidingContainerViewControllerDidHideSliderView (slidingContainerViewController: SlidingContainerViewController)
func slidingContainerViewControllerDidShowSliderView (slidingContainerViewController: SlidingContainerViewController)
}
The tab bar slider view in the sliding container view controller.
Fully customisable with its appearance
property.
struct SlidingContainerSliderViewAppearance {
var backgroundColor: UIColor
var font: UIFont
var selectedFont: UIFont
var textColor: UIColor
var selectedTextColor: UIColor
var outerPadding: CGFloat
var innerPadding: CGFloat
var selectorColor: UIColor
var selectorHeight: CGFloat
}