반응형
평소 Xcode를 사용하면 우측 상단에 다음과 같은 그림을 많이 보았을 것이다.
Swift의 마크다운 용어를 사용할 경우 다음과 같이 주석을 예쁘게 정리할 수 있다!
/// Writes the textual representation of each ← Summary 요약
/// element of `items` to the standard output.
/// ← Blank line 빈줄
/// The textual representation for each item `x` ← Additional discussion
/// is generated by the expression `String(x)`.
///
/// - Parameter separator: text to be printed ⎫
/// between items. ⎟
/// - Parameter terminator: text to be printed ⎬ Parameters section
/// at the end. ⎟
/// ⎭
/// - Note: To print without a trailing ⎫
/// newline, pass `terminator: ""` ⎟
/// ⎬ Symbol commands
/// - SeeAlso: `CustomDebugStringConvertible`, ⎟
/// `CustomStringConvertible`, `debugPrint`. ⎭
평소 주석 달 시간에 메소드명을 더 명확하게 짓고자 노력하지만
주석이 필요한 경우에 잘 활용해 보아야겠다. 😊
출처: https://cozzin.gitbook.io/swift-api-design-guidelines/fundamentals
반응형
'앱개발 > iOS' 카테고리의 다른 글
[iOS] SwiftLint 적용하기 (0) | 2020.05.21 |
---|---|
Error Domain=NSURLErrorDomain Code=-1200 에러 해결 (0) | 2020.05.17 |
[Xcode] LLDB Debugger (0) | 2020.04.15 |
Xcode 단축키 (0) | 2020.04.14 |
[iOS] Firebase 사용하기 (0) | 2019.07.11 |