XCode5中函数文档的参数描述如何换行?

6bc51xsx  于 2023-04-22  发布在  其他
关注(0)|答案(1)|浏览(113)

我读过这个问题What are the new documentation commands available in Xcode 5?。我也学过\n: doesn't generate a newline. One way to create a newline is by making sure nothing is on that line. Not even a single space character!。但是这个只能在函数描述部分工作,不能在参数描述部分工作。
我的问题是我如何才能达到像苹果文档的效果如下:

感谢您的评分

pokxtpni

pokxtpni1#

我在数组文档中发现了同样的新行。看起来只有当参数是块时才有效。这里是来自苹果的示例

/// - Parameters:
    ///   - unsafeUninitializedCapacity: The number of elements to allocate
    ///     space for in the new array.
    ///   - initializer: A closure that initializes elements and sets the count
    ///     of the new array.
    ///     - Parameters:
    ///       - buffer: A buffer covering uninitialized memory with room for the
    ///         specified number of elements.
    ///       - initializedCount: The count of initialized elements in the array,
    ///         which begins as zero. Set `initializedCount` to the number of
    ///         elements you initialize.
    @inlinable public init(unsafeUninitializedCapacity: Int, initializingWith initializer: (_ buffer: inout UnsafeMutableBufferPointer<Element>, _ initializedCount: inout Int) throws -> Void) rethrows

链接到开源的corelib,具有相同的注解

相关问题