Click here to load reader
Upload
tomohiro-kumagai
View
141
Download
3
Embed Size (px)
Citation preview
let π = 3.14 let # = "minnna_de_swift" let 📱 = "iPhone 7"
// 使えない文字もある let ⛩ = "伏見稲荷大社"
let `repeat` = 10
print(`repeat`)
let maxCapacity = 100 var amount = 10
maxCapacity = 20 amount = 20
print("A") print("A", "B") print("A", "B", separator: "&") print("A", "B", separator: "&", terminator: “;")
let a = 100 let b = 200
// 文字列の連結 print("a = " + String(a) + ", b = " + String(b))
// 文字列補完構文 print("a = \(a), b = \(b)”)
let value = 10 let string = String(describing: value)
String(describing: Int.self) // Int String(reflecting: Int.self) // Swift.Int
let v = Int.self as Int.Type?
print(v) // "Optional(Swift.Int)\n"
Mirror(reflecting: value)
for child in Mirror(reflecting: value).children { print(child)
}
extension MyData : CustomPlaygroundQuickLookable { var customPlaygroundQuickLook: PlaygroundQuickLook { return .text("My Data") } }