gpt4 book ai didi

ios - Xcode 8如何在输入时显示功能描述

转载 作者:IT王子 更新时间:2023-10-29 05:39:17 26 4
gpt4 key购买 nike

如何在输入时显示功能的简要说明,如下图所示?我尝试了很多不同的选择都失败了。

enter image description here

Option + click 有效,但这不是我要找的。

选项 1

 /// Testing...
/// - returns: false
func testing()->Bool{
return false
}

选项 2

/**
Testing option two
*/
func testing()->Bool{
return false
}

此问题已在 Xcode 9 中修复

最佳答案

如果您正在寻找在 swift 中记录自创方法的方法,那么这可能会给您一条出路。

import Foundation
/// 🚲 A two-wheeled, human-powered mode of transportation.
class Bicycle {
/**
Frame and construction style.

- Road: For streets or trails.
- Touring: For long journeys.
- Cruiser: For casual trips around town.
- Hybrid: For general-purpose transportation.
*/
enum Style {
case Road, Touring, Cruiser, Hybrid
}

/**
Mechanism for converting pedal power into motion.

- Fixed: A single, fixed gear.
- Freewheel: A variable-speed, disengageable gear.
*/
enum Gearing {
case Fixed
case Freewheel(speeds: Int)
}

/**
Hardware used for steering.

- Riser: A casual handlebar.
- Café: An upright handlebar.
- Drop: A classic handlebar.
- Bullhorn: A powerful handlebar.
*/
enum Handlebar {
case Riser, Café, Drop, Bullhorn
}

/// The style of the bicycle.
let style: Style

/// The gearing of the bicycle.
let gearing: Gearing

/// The handlebar of the bicycle.
let handlebar: Handlebar

/// The size of the frame, in centimeters.
let frameSize: Int

/// The number of trips travelled by the bicycle.
private(set) var numberOfTrips: Int

/// The total distance travelled by the bicycle, in meters.
private(set) var distanceTravelled: Double

/**
Initializes a new bicycle with the provided parts and specifications.

- Parameters:
- style: The style of the bicycle
- gearing: The gearing of the bicycle
- handlebar: The handlebar of the bicycle
- frameSize: The frame size of the bicycle, in centimeters

- Returns: A beautiful, brand-new bicycle, custom built
just for you.
*/
init(style: Style, gearing: Gearing, handlebar: Handlebar, frameSize centimeters: Int) {
self.style = style
self.gearing = gearing
self.handlebar = handlebar
self.frameSize = centimeters

self.numberOfTrips = 0
self.distanceTravelled = 0
}

/**
Take a bike out for a spin.

- Parameter meters: The distance to travel in meters.
*/
func travel(distance meters: Double) {
if meters > 0 {
distanceTravelled += meters
++numberOfTrips
}
}
}

enter image description here

Swift-Documentation on NSHipster

关于ios - Xcode 8如何在输入时显示功能描述,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40300275/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com