title: Why am I unable to interact with my Button? Swift
body: <p>I have the code below. I added a button and want something to happen when I press it, but it doesn't seem to work. In this case I want the system to print out "hi" and "hey". I can't seem to figure out the problem. Any help would be appreciated. </p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UIScrollViewDelegate {
      var scrollView: UIScrollView!
      var containerView = UIView()
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          var buttonOne: UIButton!
  
          buttonOne = UIButton(type: UIButtonType.System)
          buttonOne.setTitle("Level 1", forState: UIControlState.Normal)
  
          buttonOne.frame = CGRectMake(10, 50, 100, 100)
          buttonOne.backgroundColor = UIColor.blueColor()
          buttonOne.titleLabel?.font = UIFont.systemFontOfSize(17)
          buttonOne.setTitleColor(UIColor.whiteColor(), forState: UIControlState.Normal)
          buttonOne.addTarget(self, action: Selector("clicked:"), forControlEvents: UIControlEvents.TouchUpInside)
  
          self.scrollView = UIScrollView()
          self.scrollView.delegate = self
          self.scrollView.contentSize = CGSizeMake(0, 1000)
  
          containerView = UIView()
  
          scrollView.addSubview(containerView)
          view.addSubview(scrollView)
          containerView.addSubview(buttonOne)
      }
  
      func clicked(sender: AnyObject){
          NSLog("Hey")
          print("hi")
      }
  
      override func viewDidLayoutSubviews() {
          super.viewDidLayoutSubviews()
  
          scrollView.frame = view.bounds
          containerView.frame = CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height)
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
      }
  }
  </code></pre>