DividerView
Simplifies the creation of a one pixel line on any device.
- Horizontal or vertical
- Works with or without autolayout.
- Can be created programmatically or in storyboards/xibs
Example
To run the example project, run pod try DividerView
.
Usage
Programmatically
Create a new instance and set the axis to DividerAxis.horzontal
or DividerAxis.vertical
. This can be done with the init method DividerView(axis:)
.
let divider = DividerView(axis: .horizontal)
or by setting the type
property.
divider.axis = DividerAxis.horzontal;
Storyboard/Xib
-
Add a UIView.
-
In the Identity Inspector (⌥⌘3), set the class to
DividerView
. -
You may also need to set the module to
DividerView
if it isnt set automatically. -
In the Attribute Inspector (⌥⌘4), set the
vertical
option bool to match the type of divider you want to create (default is NO).
Installation
DividerView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "DividerView"
License
DividerView is available under the MIT license. See the LICENSE file for more info.