日記
カレーが呼んでいるのでサクッと書いた.おわり
今日書いたコード
struct Resolution { var width = 0 var height = 0 } class VideoMode { var resolution = Resolution() var interlaced = false var frameRate = 0.0 var name: String? } let hd = Resolution(width: 1920, height: 1080) let tenEighty = VideoMode() tenEighty.resolution = hd tenEighty.interlaced = true tenEighty.name = "1080i" tenEighty.frameRate = 25.0 let alsoTenEighty = tenEighty alsoTenEighty.frameRate = 30.0 print("The frameRate property of tenEighty is now \(tenEighty.frameRate)") // => Prints "The frameRate property of tenEighty is now 30.0"
初めて知ったこと
ポインタとバッファを扱う型があるらしい
The standard library provides pointer and buffer types that you can use if you need to interact with pointers directly—see Manual Memory Management.
https://docs.swift.org/swift-book/LanguageGuide/ClassesAndStructures.html