#import "ViewController.h"

@implementation ViewController
NSArray *imgArr;

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self populateArray];
    
    _mySlider.minimumValue = 0;
    _mySlider.maximumValue = imgArr.count - 1;
}

- (IBAction)slideAction:(id)sender
{ // round, floor, ceil
    int myIndex = roundf ( _mySlider.value );
    _myImgView.image = [UIImage imageNamed: imgArr[myIndex]];
}


-(void)populateArray
{
    imgArr = [[NSArray alloc] initWithObjects:
              @"3848765-wallpaper-images-download.jpg",
              @"birds.jpg",
              @"cat.jpg",
              @"eye.jpg",
              @"image-slider2.jpg",
              @"images.jpg",
              @"img.jpg",
              @"Spring-Lamb.-Image-shot-2-011.jpg", nil];
}
@end
