前言
文中將要介紹以下四點內容
下面話不多說了,來一起看看詳細的介紹吧
一 . 意義在于節約時間成本
like我在編譯器鍵入 strong, 回車自動生成@property (nonatomic, strong) <#Class#> *<#object#>;
二 . 如何自定義代碼塊
如下圖所示 選中一行代碼右鍵 crate code snippet
右上角方框快速進入
圖1
下圖填入描述, 以及快捷方式
圖2
三 . iOS Xcode自定義代碼塊遷移
四 . 代碼塊編寫
下面我舉個栗子 . 0.O
- (UITableView *)<#tableview#> { if(!<#tableview#>) { <#tableview#> = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain]; <#tableview#>.delegate =self; <#tableview#>.dataSource =self; [<#tableview#> registerClass:[<#cell#> class] forCellReuseIdentifier:@"cellIdentifier"];} return <#tableview#>;}#pragma mark - tableView delegate- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return <#expression#>}- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return <#expression#>}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { <#UITableViewCell#> *cell = [tableView dequeueReusableCellWithIdentifier:@"cellIdentifier"]; return cell; }- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { }
注: <#class#>
即為可以替換的詞語.
我再舉個栗子
@property (nonatomic, assign) <#Class#> <#object#>;
總結
留作備忘
給需要的人
好了,以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作具有一定的參考學習價值,謝謝大家對武林網的支持。
新聞熱點
疑難解答