Skip to content

morrislwt/MLscrollruler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scrollruler

Version License Platform Swift version

Demo image

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 9 or higher

Installation

scrollruler is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MLscrollruler'

How to use

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()
}

Author

morrislwt, morris.lwt@gmail.com

License

scrollruler is available under the MIT license. See the LICENSE file for more info.

About

A ruler view can edit frame and color

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published