全部類別、屬性、方法、列舉,皆用詳細註解(option + cmd + /)
/// 車子
class Car {
/// 速度
private var speed = 10
/// 出發
///
/// - Parameters:
/// - key: 鑰匙
/// - destination: 目的地
func run(key: String, destination: String){
// ...
}
}
func run(key: String, destination: String){
// Step1: 使用鑰匙發動車子
start(key: key)
// Step2: 往目的地前進
runLoop(destination: destination)
}
// MARK: - TransportationDelegate
extension Car: TransportationDelegate {
}