标签:
import UIKit
var v = UIView(frame:CGRectMake(0,0,200, 200))
var b = UIButton(frame: CGRectMake(0, 0, 44, 44))
b.setTitle("44pix btn", forState: UIControlState.Normal)
v.addSubview(b)
////
class Animal{
var name = "default"
var age = 0
func getDetails() ->String{
return "this animals name is \(name) it is \(age) years old"
}
}
var myAnimal = Animal()
myAnimal.name = "ok"
myAnimal.age = 1
myAnimal.getDetails()
标签:
原文地址:http://www.cnblogs.com/yshgxm/p/5246186.html