还是一样,我们先看看例子
看看使用代码,比较简单了
import UIKit
import WMPageController
class HomeViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let viewsitem = [ ViewController1().classForCoder,ViewController2().classForCoder,ViewController1().classForCoder,ViewController2().classForCoder,ViewController1().classForCoder]
let viewsTitle=[
"测试1", "测试2", "测试2", "测试2", "测试2"
]
let pageVC = WMPageController(viewControllerClasses: viewsitem, andTheirTitles: viewsTitle)
pageVC?.title="测试标题"
pageVC?.menuItemWidth = 85 //每个 MenuItem 的宽度
pageVC?.menuHeight=50 //导航栏高度
pageVC?.postNotification = true //
pageVC?.bounces = true
pageVC?.titleSizeSelected=13 //选中时的标题尺寸
pageVC?.titleSizeNormal=14 //非选中时的标题尺寸
pageVC?.menuViewStyle = .line //Menu view 的样式,默认为无下划线
pageVC?.titleColorSelected=UIColor.red //标题选中时的颜色, 颜色是可动画的.
pageVC?.titleColorNormal=UIColor.black //标题非选择时的颜色, 颜色是可动画的
pageVC?.menuBGColor=UIColor.white //导航栏背景色
self.navigationController?.show(pageVC!, sender: nil)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
如需代码,请移动到--->http://www.jianshu.com/p/0f950c180cb8