odegeasslbc / SlideView

A top slide navigator based on UIView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SlideNaviView

A slide navi controller

Integrated by UIView rather than UIViewController.

alt tag

alt tag

##USAGE ###Initialize

let slideNaviView = SlideNaviView(frame: CGRect) 

###Modification

slideNaviView.modifyMainViewUnit(atIndex: 2, operation: {view in view.backgroundColor = UIColor.blueColor()})
slideNaviView.modifyLabelUnit(atIndex: 0, operation: {label in label.text = ""})

###Add unit views

//initialize reach sub views

var firstView = UIView(frame: CGRectMake(0, 2, 20, 20))

firstView.backgroundColor = UIColor.greenColor()

var secondView = UIView(frame: CGRectMake(0, 2, 20, 20))

secondView.backgroundColor = UIColor.greenColor()

var thirdView = UIView(frame: CGRectMake(0, 2, 20, 20))

third.backgroundColor = UIColor.greenColor()

var tmp = [UIView]()

tmp.append(firstView)

tmp.append(secondView)

// sub views can be inserted directly
slideNaviView.insertMainView(2, view: thirdView)
// sub views can also be inserted together as an array of views
slideNaviView.setMainViews(tmp)

About

A top slide navigator based on UIView


Languages

Language:Swift 100.0%