1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
|
YLMainQueue: dispatch_async(dispatch_get_main_queue(), ^{ });
YLAlloc: <#type#> *<#name#> = [[<#type#> alloc] <#init#>];
YLCreateSelector: - (void)<#createSeletor#> { }
YLLazyCustomObject: - (<#type#> *)<#name#> { if (!_<#name#>) { _<#name#> = <#statements#>; } return _<#name#>; }
YLLazyView: - (UIView *)<#name#>{ if (!_<#name#>) { _<#name#> = [[UIView alloc] init]; _<#name#>.layer.cornerRadius = <#value#>; _<#name#>.layer.masksToBounds = YES; _<#name#>.backgroundColor = [UIColor <#color#>]; } return _<#name#>; }
YLLazyLabel: - (UILabel *)<#name#>{ if (!_<#name#>) { _<#name#> = [[UILabel alloc] init]; _<#name#>.text = @"<#text#>"; _<#name#>.font = kFont(<#value#>); _<#name#>.textAlignment = <#NSTextAlignment#>; _<#name#>.textColor = [UIColor <#color#>]; } return _<#name#>; }
YLLazyButton: - (UIButton *)<#name#>{ if (!_<#name#>) { _<#name#> = [UIButton buttonWithType:UIButtonTypeCustom]; _<#name#>.layer.cornerRadius = <#value#>; _<#name#>.layer.masksToBounds = YES; [_<#name#> setTitleColor:<#color#> forState:UIControlStateNormal]; [_<#name#> setTitle:@"<#title#>" forState:UIControlStateNormal]; [_<#name#> addTarget:self action:@selector(<#selector#>) forControlEvents:UIControlEventTouchUpInside]; } return _<#name#>; }
YLLazyImageView: - (UIImageView *)<#name#>{ if (!_<#name#>) { _<#name#> = [[UIImageView alloc] init]; _<#name#>.image = [UIImage imageNamed:@"<#name#>"] } return _<#name#>; }
YLLazyTextField: - (UITextField *)<#name#> { if (!_<#name#>) { _<#name#> = [[UITextField alloc] init]; _<#name#>.placeholder = @"<#text#>"; _<#name#>.font = <#value#>; _<#name#>.delegate = self; _<#name#>.textColor = <#color#>; _<#name#>.textAlignment = <#NSTextAlignment#>; _<#name#>.backgroundColor = <#color#>; _<#name#>.layer.borderWidth = <#value#>; _<#name#>.layer.borderColor = <#color#>.CGColor; [self.contentView addSubview:_<#name#>]; } return _<#name#>; }
YLLazyTextView: - (UITextView *)<#name#>{ if (!_<#name#>) { _<#name#> = [[UITextView alloc] init]; _<#name#>.delegate = self; _<#name#>.editable = <#value#>; _<#name#>.font = kFont(<#value#>); _<#name#>.text = @"<#value#>"; _<#name#>.textColor = <#color#>; _<#name#>.layer.borderColor = <#color#>.CGColor; _<#name#>.layer.borderWidth = <#value#>; _<#name#>.layer.cornerRadius = <#value#>; _<#name#>.layer.masksToBounds = YES; _<#name#>.backgroundColor = <#color#>; _<#name#>.userInteractionEnabled = <#value#>; } return _<#name#>; }
YLLazyAlertView: - (UIAlertView *)<#name#>{ if (!_<#name#>) { _<#name#> = [[UIAlertView alloc] initWithTitle:@"<#提示#>" message:@"<#message#>" delegate:<#self#> cancelButtonTitle:@"<#确定#>" otherButtonTitles:<#nil#>, nil]; } return _<#name#>; }
YLLazyTableView: - (UITableView *)<#tableName#>{ if (!_<#tableName#>) { _<#tableName#> = [[UITableView alloc] initWithFrame:CGRectMake(<#CGFloat x#>, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>) style:<#UITableViewStyleType#>]; _<#tableName#>.dataSource = self; _<#tableName#>.delegate = self; _<#tableName#>.backgroundColor=kgraColor; _<#tableName#>.showsVerticalScrollIndicator = NO; _<#tableName#>.separatorStyle = UITableViewCellSelectionStyleNone; _<#tableName#>.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; [_<#tableName#> registerClass:[<#cellName#> class] forCellReuseIdentifier:<#identifity#>]; [self.view addSubview:_<#tableName#>]; } return _<#tableName#>; }
YLLazyTableViewDelegate: #pragma mark - tableView -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; }
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return <#expression#> }
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { <#classCell#> * cell = [tableView dequeueReusableCellWithIdentifier:<#(nonnull NSString *)#>]; return cell; }
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { }
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return <#expression#> }
YLStrongSelf: __strong __typeof(weakSelf)strongSelf = weakSelf;
YLWeakSelf: __weak __typeof(self)weakSelf = self;
YLTitleAndBackgroundColor: self.title = @"<#title#>"; self.view.backgroundColor = <#color#>;
YLStrong: /** <#strong属性注释#> */ @property (nonatomic, strong) <#Class#> <#name#>;
YLWeak: /** <#weak属性注释#> */ @property (nonatomic, weak) <#Class#> *<#name#>;
YLAssign: /** <#assign属性注释#> */ @property (nonatomic, assign) <#Class#> <#name#>;
YLCopy: /** <#copy属性注释#> */ @property (nonatomic, copy) <#Class#> *<#name#>;
YLBlock: /** <#block#> */ @property (nonatomic, copy) <#Block#> <#block#>;
YLDelegate: /** <#delegate#> */ @property (nonatomic, weak) id<<#protocol#>> delegate;
YLShadow: <#name#>.layer.shadowColor = <#cgcolor#>; <#name#>.layer.shadowOpacity = <#value#>; <#name#>.layer.shadowOffset = CGSizeMake(<#value#>, <#value#>); <#name#>.layer.shadowRadius = <#value#>;
YLMark: #pragma mark - <#mark#>
YLSelfViewAddSubview: [self.view addSubview:self.<#name#>];
YLSelfContentViewAddSubview: [self.contentView addSubview:self.<#name#>];
YLSelfAddSubview: [self addSubview:self.<#name#>];
|
近期评论