ios - Swift swipe through photos randomly -


originally had different post, wanted redo clean up.

enter image description here

this more or less layout wanted go with. imagine first imageview had dog pictures, second 1 had cat pictures , third 1 had rabbit pictures. 3 folders contain group of 3 separate sets of pictures.

what best way set can randomly swipe, lets first image view show pictures of dogs.

what asking is, there way create file structures or link pictures each image view?

i have basics of random (something 4 in don't remember method exactly) , basics of swipe, looking linking photos , file structure.

please let me know if still doesn't make sense.

thank you

edit

after messing this at:

with simple array

catsarray: [string] = ["catpic1","catpic2"......] 

then have set as

        let randomindex = int(arc4random_uniform(uint32(catarray.count)))      if (sender.direction == .right)     {         self.catimageview.image = uiimage(named: catarray[randomindex])     } 

just me hacking things off internet. running issue. after few swipes null images or blank. why that?

now have of set debating if should use parse server or if there better way.

thanks

either approach work. it's exercise write both versions. you'd learn it.


Comments