标签:
var btn = UIButton()
btn.frame = CGRectMake(20, 20, 100, 80)
btn.backgroundColor = UIColor.blueColor()
self.view.addSubview(btn)
var imageView = UIImageView(image: UIImage(named: "2x"))
imageView.frame = CGRectMake(20, 100, 100, 100)
self.view.addSubview(imageView)
import UIKit
//var str = "Hello, playground"
//var num = 12
//num++
//num += 11 + 12 * 3
var btn = UIButton()
btn.frame = CGRectMake(0, 0, 100, 100)
btn.backgroundColor = UIColor.redColor()
btn.layer.cornerRadius = 10
btn
var str = "a b c"
var str2 = " d e f"
var string = str + str2 // 拼接字符串
var age = 18; var num = 1024
var name = "lily"
var lily = name + " is \(age) years old, and no " + String(num)
print(lily)
标签:
原文地址:http://www.cnblogs.com/Miracle-Huang/p/5789667.html