欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

iOS Xcode自定義代碼塊及遷移的實現(xiàn)方法

 更新時間:2019年04月17日 09:23:17   作者:夏天然后  
這篇文章主要給大家介紹了關(guān)于iOS Xcode自定義代碼塊及遷移的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家學(xué)習(xí)或者使用iOS Xcode具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧

前言

文中將要介紹以下四點內(nèi)容

  • 代碼塊的意義
  • 自定義代碼塊入口
  • 代碼塊遷移
  • 代碼塊的編寫

下面話不多說了,來一起看看詳細的介紹吧

一 . 意義在于節(jié)約時間成本

like
我在編譯器鍵入 strong, 回車
自動生成
@property (nonatomic, strong) <#Class#> *<#object#>;

二 . 如何自定義代碼塊

如下圖所示 選中一行代碼右鍵 crate code snippet

右上角方框快速進入

圖1

下圖填入描述, 以及快捷方式

圖2

三 . iOS Xcode自定義代碼塊遷移

  1. Command + Shift + G. 前往如下路徑的文件夾
  2. 路徑 : ~/Library/Developer/Xcode/UserData/CodeSnippets
  3. 把文件夾內(nèi)部的文件復(fù)制, 粘貼到另一臺電腦的Xcode同樣的文件夾中即可
  4. 重啟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#>;

總結(jié)

留作備忘

給需要的人

好了,以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,謝謝大家對腳本之家的支持。

相關(guān)文章

最新評論