CocoaPods trunk is moving to be read-only. Read more on the blog, there are 9 months to go.
| TestsTested | ✗ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Dec 2014 |
Maintained by Peter Stuart.
EPSUIFactory is a class which provides factory methods for common configurations of UIKit controls. Some examples are:
UILabelUITextField set up for email entryUITextField set up for password entryUIView set up to be used as the container view in a UIScrollView which should only scroll verticallyAll views returned by EPSUIFactory are ready to be used with auto layout (ie. they have translatesAutoresizingMaskIntoConstraints set to NO.)
- (void)viewDidLoad {
[super viewDidLoad];
UITextField *passwordField = [EPSUIFactory passwordTextField];
[self.view addSubview:passwordField];
// Add some constraints on `passwordField`
...
}For complete documentation of the methods available, see EPSUIFactory.h.
There is an included category on UIView which makes setup for views not included in the factory methods easier. Use eps_initForAutoLayout instead of initWithFrame: when you are creating a view for use with auto layout. For example:
UIView *view = [[UIView alloc] eps_initForAutoLayout];is equivalent to
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
view.translatesAutoresizingMaskIntoConstraints = NO;To run the example project; clone the repo, and run pod install from the “Project” directory first.
EPSUIFactory is available through CocoaPods, to install it simply add the following line to your Podfile:
pod "EPSUIFactory"Alternatively, add all files from the “Classes” folder to your project.
EPSUIFactory is available under the MIT license. See the LICENSE file for more info.