Xcode配置及快捷鍵

1、基本配置

  1. 背景配置: 
    Xcod->Preference->Fonts&Colors 選擇 Background 配置爲比較養眼的淡綠色背景 RGB:227,237,205
  2. 字體配置: 
    樣式選擇Default,選擇所有選項,點擊Font,設置一個本身適合的字號: 
    替代文字
  3. Show Line Numbers:在gutter中顯示行號。
  4. Code folding ribbon:顯示摺疊ribbon。
  5. Page guide at column:顯示一行最多支持80個字符的提示分割線。 
    替代文字

2、經常使用快捷鍵

代碼閱讀 
  (1)View Navigator 
    command+0:Show/Hide left tool panel 
    command+1-8:Project/Symbol/Find/Issue/Test/Debug/Breakpoint/Log Navigator 
    option+command+0:Show/Hide right tool panel 
    option+command+1-6:show the file/quick help inspectorhtml

 

(2)View Editor Organization 
       control+1:Show Related Items(例如Superclasses/Subclasses、Callers/Callees、Protocol Implementor/Implemented、Includes/Included By)。可輸入實時搜索匹配。 
       control+2:Show Previous/Next History。可輸入實時搜索匹配。 
       control+4:Show Top Level Items。 
       control+5:Show Group Files(當前文件夾內的全部文件)。可輸入實時搜索匹配。 
       control+6:顯示屬性、方法結構ios

 

(3)Symbol Jump 
        command+點擊Editor中選中的符號:跳轉到符號定義(jump to definition)。 
        control+command+J:跳轉到指定符號的定義處或實現處(Go to Declaration/Definition)。ide

(4)Help 
       option+點按:查看選中符號的幫助提示(Quick Help for Selected Item)。函數

 

2.代碼編輯 
(1)File | New 
     control+command+N:File | New | Workspace 
     shift+command+N:File | New | Project字體

 

(2)Text Editing 
     command+[ / ]:向前/向後縮進 
     option+command+[/]:Move Line Up/Down 
     command+/:註釋選中的代碼ui

 

(3)Eidtor Window/Tab Switch 
     command+shift+[/]:切換標籤頁spa

(4)Code Folding 
    option+command+←/→:摺疊當前代碼塊 
    option+shift+command+←/→:摺疊該文件內全部代碼塊(方法/函數)debug

 

(5)Console & Scheme 
   shift+command+Y:顯示控制檯(Show/Hide the debug area) 
   option+command+R:編輯配置(Edit Scheme)調試

 

(6)Auto Completion 
   esc(command+.):就當前輸入上下文呼出/隱藏Autocode

 

(7)Find & Replace 
    command+F:當前文件查找。 
    option+command+F:當前文件替換。 
    shift+command+F :全局查找。 
    option+shift+command+F:全局替換。

 

3.運行調試 
(1)Console 
   shift+command+Y:顯示控制檯(Show/Hide the debug area)

 

(2)Build 
   command + B:構建(Buid)

 

(5)Run 
   command + R:運行(Run),可能會先編譯。若按下control直接運行上次build的product(Run Without Building)。 
   command + .:中止運行(Stop)

 

(6)Breakpoint 
     command + \:當前行設置/取消斷點;經過鼠標點擊藍色斷點來啓用/禁用當前行斷點。 
     command + Y:全局激活或禁用全部的斷點,激活進入調試模式(此時斷點藍色可見)。

 

(7)Debug 
     F6:下一步(Step Over),逐過程單步調試,不進入函數體。 
     (fn+)F7:進入(Step Into)函數體。可能與多媒體鍵有衝突,故須要fn輔助。 
     (fn+)F8:跳出(Step Out)函數體。可能與多媒體鍵有衝突,例如呼叫iTunes,故須要fn輔助。 
     control+command+Y:逐斷點(continue)繼續執行。

 

參考:Xcode基本操做

相關文章
相關標籤/搜索