1.關(guān)于運(yùn)行調(diào)試
? ? Command ?R ?編譯并運(yùn)行(不觸發(fā)斷點(diǎn))
? ? Command ?Y ?編譯并調(diào)試(觸發(fā)斷點(diǎn))
? ? Command? .? ? 停止
? ? ?cmd ?\ ? ? ? ? ? ? 設(shè)置或者取消斷點(diǎn)
? ? ?cmd ?opt ?\ ? ? ?允許或者禁用當(dāng)前斷點(diǎn)
? ? ?cmd ?B ? ? ? ? ? ? 編譯
? ? ?cmd shift ?K ? ? 清理 ? ??
2.導(dǎo)航
? Command control ?上下箭頭鍵 ? ? ? ? 用來切換頭文件和m.文件,很實(shí)用
? ?control Command 左箭頭 回到上次你打開的頁面
? control Command 右箭頭? 回到你前面打開的頁面
3.文件
command u 還原到保存時(shí)狀態(tài)
4.編輯代碼
? ? 1)代碼縮進(jìn)
? ? ? ? 左縮進(jìn) ?command [
? ? ? ? 右縮進(jìn) ?command ]
? ? 2)代碼編輯
? ? ? ? ?control ?F ?向右一個(gè)字符
? ? ? ? ?control ?B ?向左一個(gè)字符
? ? ? ? ?control ?P ? 向前一行
? ? ? ? ?control N ? ?向后一行
? ? ? ? ?control A ? ?去行首
? ? ? ? ? control E ? ?到行尾
? ? ? ? ? control T ? ?調(diào)換光標(biāo)兩邊的字符
? ? ? ? ?control D ? ?刪除光標(biāo)右邊的字符
? ? ? ? ? control K ? ?刪除本行剩余的字符
? ? ? ? ? cmd ctrl 左箭頭 ? ? ? ? ? 折疊
? ? ? ? ? cmd ctrl 右箭頭 ? ? ? ? ? 取消折疊
? ? ? ? ? cmd ctrl ?上箭頭 ? ? ? ? 折疊全部函數(shù)
? ? ? ? ? ?cmd ctrl ?下箭頭 ? ? ? ? 取消全部函數(shù)折疊
? ? ? ? ? ?ctrl ? U ? ? ? ? ?取消全部折疊
? ? ? ? ? ?cmd ?/ ? ? ? ? ?注釋或者取消注釋
? ? ? ? ? ? ctrl ?. ? ? ? ? ? ? 參數(shù)提示
? ? ? ? ? ? esc ? ? ? ? ? ? ? ?自動(dòng)提示列表
? ?3)文檔內(nèi)搜索
? ? ? ? ? command ?F ? 搜索
? ? ? ? ? command ?G ?搜索下一處
? ? ? ? ? shift command ? G ?搜索上一處
5.其他
storyboard 內(nèi)的視圖放大或縮小
選中storyboard 空白區(qū)域
放大:shift ?command ?-
縮星K睢:shift ?command ?+
command ?option ?= ? ? ? ?修復(fù)frame
command ?shift ?| ? ? ? ? ? ? 添加當(dāng)前View的垂直中線
command ?shift ?— ? ? ? ? ?添加當(dāng)前View的水平中線
查看某個(gè)視圖的層級關(guān)系: 按住shift糜工,在想要查看的視圖上右擊
查看兄弟視圖之間的距離:選中一個(gè)控件,按住option(alt)按鍵和媳,想要查看與誰之間的距離侣滩,用鼠標(biāo)去觸碰那個(gè)控件即可
按住control鍵除了可以生成屬性和方法外沾谜,還可以生成約束(缺點(diǎn):拖拽添加的約束有個(gè)缺點(diǎn)巴碗,就是月數(shù)值就是當(dāng)前值浴讯,添加過程中無法修改,如需要修改究流,需要添加后再選擇修改)
右擊出現(xiàn)的HUD辣吃,多個(gè)共存的方法:右擊,顯示出來后芬探,點(diǎn)擊頂部拖動(dòng)神得,只要拖動(dòng)了就可以長存屏幕
快速復(fù)制一個(gè)控件: ctrl ? d
單個(gè)view:
固定寬高
alt + W
alt + H
上下左右固定:
command + alt + 方向左
command + alt + 方向右
command + alt + 方向上
command + alt + 方向下
居中
command + ctrol + -
command + ctrol + \
選中兩個(gè)view的:
等寬等高
ctrol + alt + w
ctrol + alt + h
對齊
ctrol + alt + 方向左
ctrol + alt + 方向右
ctrol + alt + 方向上
ctrol + alt + 方向下
居中對齊
ctrol + alt + -?? 水平居中對齊
ctrol + alt + \?? 垂直居中對齊
彼此水平垂直間隔固定
ctrol + alt + shift + -? 水平間隔
ctrol + alt + shift + \? 垂直間隔
清除當(dāng)前選中的view的約束:
shift + k
設(shè)置的規(guī)律:
1、方向鍵偷仿,做方向類的約束
2哩簿、w、h鍵做寬高類約束
3酝静、k做刪除約束
4节榜、單個(gè)view上面的約束,一定沒有ctrol
5别智、多個(gè)view上面的約束宗苍,一定沒有command,一定有ctrol薄榛,一定有三個(gè)鍵
6讳窟、除了垂直水平可能會(huì)有四個(gè)鍵,其他一律不超過3個(gè)鍵