title: "Expected Declaration" in Swift
body: <p>I tried to code a program which has two images. I use 4 buttons UP, DOWN, LEFT, RIGHT to move one image. <strong>If that image reaches the other, a text field will show up: "You are the winner!".</strong></p>
  
  <p>However, the line containing the code If... always gets "Expected Declaration" error. How can I make it run, pls?</p>
  
  <p>This is the whole code, the names of two images are ConChimCu and Trung:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
      @IBOutlet weak var txtBai: UITextView!
      @IBOutlet weak var ConChimCu: UIImageView!
      @IBOutlet weak var Trung: UIImageView!
  
      @IBAction func Up(sender: AnyObject) {
         ConChimCu.frame.origin.y = ConChimCu.frame.origin.y - 2
     }
  
      @IBAction func RIGHT(sender: AnyObject) {
          ConChimCu.frame.origin.x = ConChimCu.frame.origin.x + 2
      }
  
      @IBAction func DOWN(sender: AnyObject) {
          ConChimCu.frame.origin.y = ConChimCu.frame.origin.y + 2
      }
  
      @IBAction func LEFT(sender: AnyObject) {
          ConChimCu.frame.origin.x = ConChimCu.frame.origin.x - 2
      }
  
      if ConChimCu.frame.origin.x == Trung.frame.origin.x { txtBai.text = "You are the winner!"
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  </code></pre>