TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Mar 2017 |
Maintained by Julian Drapaylo.
KRNNib is a simple class that helps your load nibs and instantiate views from nibs.
All methods of KRNNib are static so you can simply call any of method without necessity of allocation of KRNNib instance.
//instantiate UINib instance from main bundle by name or with data stored in memory
+ (UINib *)nibWithName:(NSString *)nibName;
+ (UINib *)nibWithData:(NSData *)data;
//returns first UIView instance from nib from main bundle by name or with data stored in memory
+ (UIView *)viewFromNibWithName:(NSString *)nibName;
+ (UIView *)viewFromNibWithData:(NSData *)data;
For example, if you have a TestView.xib file you can instatiate a view from it like in example below:
UIView *view = [KRNNib viewFromNibWithName:@"TestView"];
[self.view addSubview:view]; // add instantiated view as subview to view of current UIViewController
Feel free to look into example project which clearify how to use KRNNib.
KRNNib is released under the MIT license. See LICENSE for details.
Any suggestion or question? Please create a Github issue or reach me out.