Do you want to easily create UIView subclasses and initialize them via code, storyboards or XIBs?
Do you want to separate your logic into small components when you have THAT complex ViewController?
Do you want to reuse your component anywhere without caring about how to initialize it?
Do you want all of these things even working with Auto Layout?
RCView does it for you!
To run the example project, clone the repo, and run pod install
from the Example directory first.
Now all you need to do is to create a subclass of RCView and a XIB file for your view.
Drag a View from the Object Library to you XIB / storyboard and assign your subclass in the View's Class property.
If you're not using autolayout and want to set a frame to your view:
[[MyViewSubclass alloc] initWithFrame:frame];
If you're using Auto Layout in your View's superview you can simply call:
[[MyViewSubclass alloc] init];
And add the appropriate constraints later.
If you want to provide custom initializers for your view remember to call super initializers in their implementations.
Your view's XIB file must have the same name of your view subclass.
If you need to create outlets, once in your XIB, assign the subclass to the File's Owner Class property (do not assign your subclass to the View's Class property).
RCView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "RCView"
Renan Cargnin (renansep), renansep93@gmail.com
RCView is available under the MIT license. See the LICENSE file for more info.