我有几个关于Swift文档评论的问题。
发布于 2018-04-17 11:44:13
可以使用标记来编写playground和代码文档注释。
//:
或/*: */
///
或/** */
/// This function returns a *hello* string for a given `subject`.
///
/// - Warning: The returned string is not localized.
///
/// Usage:
///
/// println(hello("Markdown")) // Hello, Markdown!
///
/// - Parameter subject: The subject to be welcomed.
///
/// - Returns: A hello string to the `subject`.
func hello(subject: String) -> String {
return "Hello, \(subject)!"
}
发布于 2018-04-17 13:03:52
Xcode 7.0 beta 4
/// Creates the string representation of the poo with requested size.
///
/// - warning: Be carefull! Poos can hurt.
/// - parameter size: requested size of the poo
/// - returns: string representation of the poo
func makePoo(size: String) -> String
{
return "Ouch. This is \(size) poo!"
}
看起来就像这样:
https://stackoverflow.com/questions/-100008135
复制相似问题