Skip to content

XCode 快捷键

文档注释

在函数或者变了旁边:option + command + /

可自定生成函数文档注释,会标记函数每个参数说明

swift
/// <#Description#>
/// - Parameters:
///   - val: <#val description#>
///   - text: <#text description#>
///   - isOpen: <#isOpen description#>
/// - Returns: <#description#>
func test(val: Int, text: String, isOpen: Bol) -> String {
  return isOpen ? "\(val)" : text
}

自动换行代码

Command + shift + ctrl + L