标签:swift
import Foundation println("Hello, World!") class PeopleClass{ } struct PeopleStruct{ } struct Resolution { var width = 0 var heigth = 0 } class VideoMode { var resolution = Resolution() var interlaced = false var frameRate = 0.0 var name : String? } let someResolution = Resolution() let someVideoMode = VideoMode() println("The width of someResolution is \(someResolution.width)") someVideoMode.resolution.width = 12880 println("The width of someVideoMode is now \(someVideoMode.resolution.width)") let vga = Resolution(width:640, heigth: 480) println("vga is \(vga.width) \(vga.heigth)") let hd = Resolution(width: 1920, heigth: 1080) var cinema = hd cinema.width = 2048 println("cinema is now \(cinema.width) pixels wide")
标签:swift
原文地址:http://blog.csdn.net/yin_xianwei/article/details/38018233