TDTabView
is tab View like Safari.
import UIKit
import TDTabView
class ViewController: TDTabViewController {
var vc1: UIViewController!
var vc2: UIViewController!
var vc3: UIViewController!
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
let storyboard1 = UIStoryboard(name: "Table", bundle: nil)
vc1 = storyboard1.instantiateInitialViewController()
let storyboard2 = UIStoryboard(name: "Image", bundle: nil)
vc2 = storyboard2.instantiateInitialViewController()
let storyboard3 = UIStoryboard(name: "Web", bundle: nil)
vc3 = storyboard3.instantiateInitialViewController()
}
}
extension ViewController: TDTabViewControllerDelegate {
func viewControllers() -> [UIViewController] {
return [vc1, vc2, vc3]
}
func backgroundColor() -> UIColor? {
return UIColor(red: 50/255, green: 50/255, blue: 50/255, alpha: 0.8)
}
}
Add this to your Podfile.
pod 'TDTabView'
Add this to your Cartfile.
github "ymarui/TDTabView"
MIT