title: Creating a button in the Playground app on iPad
body: <p>I am working with the new beta version of the Playground app in iOS 10.
  I want to get some UIKit elements working in a playground.
  Swift 3 is just different enough from Swift 2, I am having some problems.</p>
  
  <p>I got a label and text box working, but I cannot get a button working.
  I have the button showing up but cannot get text in it or an action working on touch-up.
  Here is my code I have.</p>
  
  <pre><code>import PlaygroundSupport
  import UIKit
  
  //
  let view = UIView()
  view.backgroundColor = #colorLiteral(red: 0.909803926944733, green: 0.47843137383461, blue: 0.643137276172638, alpha: 1.0)
  PlaygroundPage.current.liveView = view
  
  let lbl = UILabel(frame: CGRect(x: 50, y: 0, width: 200, height: 50))
  lbl.text = "Hello, World!"
  view.addSubview(lbl)
  
  let txt = UITextField(frame: CGRect(x: 150, y: 200, width: 200, height: 50))
  //txt.placeholder = "Enter text here"
  //txt.font = UIFont.systemFont(ofSize: 15)
  txt.borderStyle = UITextBorderStyle.roundedRect
  view.addSubview(txt)
  
  func buttonPressed(sender: UIButton)
  {
      //sender.backgroundColor = #colorLiteral(red: 0.725490212440491, green: 0.47843137383461, blue: 0.0980392172932625, alpha: 1.0)
  }
  
  let button = UIButton(frame: CGRect(x: 50, y: 100, width: 100, height: 50))
  button.backgroundColor = #colorLiteral(red: 0.721568644046783, green: 0.886274516582489, blue: 0.592156887054443, alpha: 1.0)
  button.setTitleColor(#colorLiteral(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0), for: UIControlState.focused)
  button.setTitle("button", for: UIControlState.focused)
  button.layer.cornerRadius = 10
  button.addTarget(button, action: "buttonPressed", for:  UIControlEvents.touchUpInside)
  view.addSubview(button)
  </code></pre>