Version License Platform Swift version
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 MLscrollrulerclass 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, morris.lwt@gmail.com
scrollruler is available under the MIT license. See the LICENSE file for more info.