swift 2.2 NO.6 -class v
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()