struct Resolution { var width = 0 var height = 0 } class VideoMode { var resolution = Resolution() var interlaced = false var frameRate = 0.0 var name: String? func description() { print("name:\(name) frameRate:\(frameRate)") } } let mode = VideoMode() mode.name = "1080p HD" mode.frameRate = 30.0 mode.description()
输入: