//
//  ViewController.swift
//  5. Image Slider
//
//  Created by Bermotech on 11/05/2018.
//  Copyright © 2018 App for Apple. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

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

    @IBAction func mySlider(_ sender: Any)
    {
        
        /*switch(changingImage.value){
        case 1..<2:
            myImage.image = UIImage(named:"field.jpg")
            
        case 2..<3:
            myImage.image = UIImage(named:"hill.jpg")
            
        case 3..<4:
            myImage.image = UIImage(named:"sea.jpg")
            
        case 4..<5:
            myImage.image = UIImage(named:"cloudyday.jpg")
            
        case 5..<6:
            myImage.image = UIImage(named:"rainbowday.jpg")
            
        case 6..<7:
            myImage.image = UIImage(named:"rainyday.jpg")
            
        case 7..<8:
            myImage.image = UIImage(named:"pier.jpg")
            
        case 8..<9:
            myImage.image = UIImage(named:"waterandmountains.jpg")
        
        case 9..<10:
            myImage.image = UIImage(named:"lake.jpg")
            
        case 10:
            myImage.image = UIImage(named:"nature.jpg")
            
            
         
        default:
            print()*/
        
        if(changingImage.value<2)
        {
            myImage.image = UIImage(named: "field.jpeg")
        }
        
        else if (changingImage.value<3)
        {
            myImage.image = UIImage(named: "hill.jpeg")
        }
        
        else if (changingImage.value<4)
        {
            myImage.image = UIImage(named: "sea.jpeg")
        }
        
        else if (changingImage.value<5)
        {
            myImage.image = UIImage(named: "cloudyday.jpeg")
        }
        
        else if (changingImage.value<6)
        {
            myImage.image = UIImage(named: "rainbowday.jpeg")
        }
        
        else if (changingImage.value<7)
        {
            myImage.image = UIImage(named: "rainyday.jpeg")
        }
        
        else if (changingImage.value<8)
        {
            myImage.image = UIImage(named: "pier.jpeg")
        }
        
        else if (changingImage.value<9)
        {
            myImage.image = UIImage(named: "waterandmountains.jpeg")
        }
        
        else if (changingImage.value<10)
        {
            myImage.image = UIImage(named: "lake.jpeg")
        }
        
        else
        
        {
            myImage.image = UIImage(named: "nature.jpeg")
        }
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

