//
//  ViewController.swift
//  viewDidLayoutSubviews
//
//  Created by yoshiyuki oshige on 2015/09/05.
//  Copyright © 2015年 yoshiyuki oshige. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var myCar: UIImageView!
    // ホーム座標を決める
    let homePoint = CGPoint(x:100, y:150)
    
    // ホームに戻る
    @IBAction func goHome(sender: AnyObject) {
        myCar.center = homePoint
    }
    
    // 右へ進む
    @IBAction func move(sender: AnyObject) {
        myCar.center.x += 10
    }
    
    // 開始時にホームに移動する
    override func viewDidLayoutSubviews() {
        myCar.center = homePoint
    }
    
    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.
    }


}

