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
To run the example project, run pod try CESDividerView
.
Create a new instance and set the type to CESDividerViewTypeHorizontal
or CESDividerViewTypeVertical
. This can be done using -initWithType:
CESDividerView *dividerView = [[CESDividerView alloc] initWithType:CESDividerViewTypeVertical];
or by setting the type
property.
dividerView.type = CESDividerViewTypeHorizontal;
-
Add a UIView.
-
In the Identity Inspector (⌥⌘3), set the class to
CESDividerView
. -
To make layout easier, in the Size Inspector (⌥⌘5), set the intrinsic size to match the type of divider you want to create.
-
To make a vertical line, in the Identity Inspector (⌥⌘3), add a boolean runtime attribute called
vertical
.
CESDividerView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CESDividerView"
CESDividerView is available under the MIT license. See the LICENSE file for more info.