<span style="white-space:pre"> </span>// button
let button = UIButton(frame:CGRect(origin: CGPointMake(50.0, 210.0), size: CGSizeMake(100, 50)))
button.backgroundColor = UIColor.redColor()
button.setTitle("ok", forState: UIControlState.Normal)
button.addTarget(self, action: "buttonClickAction:", forControlEvents: UIControlEvents.TouchUpInside)
self.view.addSubview(button)
<span style="white-space:pre"> </span>// label
var label = UILabel(frame:CGRect(origin: CGPointMake(10.0, 50.0), size: CGSizeMake(100, 50)))
label.text = "hello first"
self.view.addSubview(label)
<span style="white-space:pre"> </span>// alert view
var alert = UIAlertView()
alert.title = "hello alert"
alert.delegate = self
alert.addButtonWithTitle("ok")
alert.message = "this is alert view"
alert.show()
坚持每天学习几个swift小控件