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

import UIKit

class ViewController: UIViewController {

  
    @IBOutlet weak var myPhoto: UIImageView!
    
    @IBAction func changedFrame(sender: UISegmentedControl) {
        let index = sender.selectedSegmentIndex
        switch index {
        case 0 : // 大きく表示
            myPhoto.frame = CGRect(x: 30, y: 100, width: 320, height: 240)
        case 1 : // 小さく表示
            myPhoto.frame = CGRect(x: 110, y: 160, width: 160, height: 120)
        default :
            myPhoto.frame = CGRect(x: 30, y: 100, width: 320, height: 240)
        }
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // 表示モードの設定
        myPhoto.contentMode = .ScaleAspectFill
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

