title: Trouble with unresolved identifier self with NSTimer Swift
body: <p>I have the code bellow and I am finding a error message. Note that the code in question is not in the viewcontroller class in Swift. The images code for moving is in the viewdidappear function.</p>
  
  <pre><code>var timer = NSTimer(timeInterval:3, target: self, selector:Selector("randomnumbers:"), userInfo: nil, repeats: true)
  
  func randomnumbers(timer:NSTimer) {
      var rockNamesArray:[String] = ["bird", "rock2", "rock3"]    
      var rockpos = Int(arc4random_uniform(UInt32(3)))
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <pre><code>if rockNamesArray[rockpos] == "rock2"  {
          UIView.animateWithDuration(3.0, animations: {
              self.mrock.frame = CGRect(origin: CGPoint(x: 167, y: 600), size: self.mrock.frame.size)
              },
              completion: { _ in
                  self.mrock.frame = moriginalFrame
          })
  
      }
  </code></pre>