To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 9 or higher
scrollruler is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MLscrollruler'
import MLscrollruler
class ViewController:UIViewController,RulerDelegate{
}
func setupRuler(ruler: ScrollFrame, figure: Double) {
//you can get value when you scrolling
print("\(figure)")
}
func setup(){
//customize frame x, y and width
let centerX = view.frame.width / 2
let ruler = ScrollFrame(frame: CGRect(x: (centerX - 150), y: 120, width: 300, height: 100))
ruler.delegate = self
//customize
ruler.scrollView.backgroundColor = .lightGray
ruler.middleLine.backgroundColor = .red
ruler.rulerLine.strokeColor = UIColor.black.cgColor
view.addSubview(ruler)
}
override func viewDidLoad() {
super.viewDidLoad()
setup()
}
morrislwt, [email protected]
scrollruler is available under the MIT license. See the LICENSE file for more info.