//
//  ViewController.swift
//  3. Changing alpha with Switch
//
//  Created by Bermotech on 10/05/2018.
//  Copyright © 2018 App for Apple. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var mySwitch: UISwitch!
    @IBOutlet weak var myImage: UIImageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    @IBAction func mySwitch(_ sender: Any)
    {
        if mySwitch.isOn
        {
            myImage.alpha = 1
        }
        
        else
        {
            
            myImage.alpha = 0
        }
            
        }
    
    
    override func didReceiveMemoryWarning()
    
    {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

