A lazyload getter maker without resign
Chinese (Simplified): 中文说明
- 1.1.1
Add support for type restriction
Class<ChildClass *> * - 1.1.0
Add support for swift(test function) - 1.0.1
Ignore IBOutlet
Every time you may use lazyload.However, apple do not provide the method to quickly make getter. So this plug-in may solve your problem.
e.g.
//无视xib
@property (weak, nonatomic) IBOutlet xibSubView *subView;
//无视注释
@property (nonatomic, strong) UIView * view1;
/**
多行注释也会过滤
*/
@property (nonatomic, strong) UIView * view2;
//assign属性会被过滤
@property (nonatomic, assign) BOOL hahaha;
@property (nonatomic, copy) NSString * sting;
↓↓↓
- (UIView *)view1{
if(!_view1){
_view1 = ({
UIView * object = [[UIView alloc]init];
object;
});
}
return _view1;
}
- (UIView *)view2{
if(!_view2){
_view2 = ({
UIView * object = [[UIView alloc]init];
object;
});
}
return _view2;
}
- (NSString *)sting{
if(!_sting){
_sting = ({
NSString * object = [[NSString alloc]init];
object;
});
}
return _sting;
}
Now support var to lazy var.
e.g.
var button : UIButton!
var button1 : UIButton = UIButton()
var button2 = UIButton()
↓↓↓
lazy var button : UIButton = {
let object = UIButton()
return object
}()
lazy var button1 : UIButton = {
let object = UIButton()
return object
}()
lazy var button2 : UIButton = {
let object = UIButton()
return object
}()
- Download
- Enable this plug-in in setting
- You can Bind shortcuts in Xcode setting (shift + G)
You can use this plug-in -------> getterMake-Xcode
If your Xcode is 8.0+.
Please install macOS Sierra (version 10.12) if your macOS is 10.11.
hackxhj Give me a lot of inspiration to finish this plug-in
AMECategoryMaker
A category property maker without resigin