Swiftで変数の型またはクラスを出力するにはどうすればよいですか?
変数のランタイム型を迅速に出力する方法はありますか?例えば: var now = NSDate() var soon = now.dateByAddingTimeInterval(5.0) println("\(now.dynamicType)") // Prints "(Metatype)" println("\(now.dynamicType.description()") // Prints "__NSDate" since objective-c Class objects have a "description" selector println("\(soon.dynamicType.description()") // Compile-time error since ImplicitlyUnwrappedOptional<NSDate> has no "description" method 上記の例では、変数「soon」のタイプがImplicitlyUnwrappedOptional<NSDate>少なくともであることを示す方法を探していますNSDate!。