NMMultiUnitRuler
iOS library to select different size units using a Scrollable Ruler
It is simple customizable ruler control that support multiple units. The control supports these features:
- Customizable interface
- Compatible with iOS 11.0 NSUnit Framework
- Supports multiple units
- Customize marker colors based on type or their value
- Customize the width, length and number of markers of the ruler
- Customize the unit formatter
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Installation
NMMultiUnitRuler is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "NMMultiUnitRuler"
and run pod install in terminal. Usage
Compatibility
iOS 11+
xCode 9.0+
Swift 5.0
####You can use storyboard to create a control element.
How to use
class ViewController: UIViewController, NMMultiUnitRulerDataSource, NMMultiUnitRulerDelegate {
}
Set the ruler direction to horizontal
ruler.direction = .horizontal
ruler.direction = .vertical
Specify how many units the ruler will display
var numberOfSegments: Int {
get {
return 2.0
}
}
Originally inspired by RKMultiUnitRuler