// 1.UILabel
let myLabel = UILabel(frame:CGRectMake(10,20,200,20))
myLabel.textColor...UIImageView
let myImgView = UIImageView(frame: CGRectMake(20, 20, 100, 100))
let url...= NSURL(string: "http://hangge.com/blog/images/logo.png")
let data = NSData(contentsOfURL: url...myImgView.frame = CGRectMake(200, 200, 100, 100)
}
写到这里,我想有OC经验的开发者已经发现,两种语言控件的属性是一样的,只是语法有些不一样而已,多写几个就会发现Swift...}
当然,别的方法也是一样,如点击单元格:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath