I have looked on google and stack flow, and although I have found similar responses, I am still no more wiser then before I set out my hunt for the solution to this problem.
I have one button, that each time pressed I want it to show the next image.
I believe I have to set up an array of all of the images I have in my project to do this, then maybe something like a counter for the button so it knows which image to show in the UIImageView.
So the project is something like this:
1 x view controller, with 1 x UIImageView, 1 x button, and say 5 images.
UIImageView takes up the whole screen, image 1 displayed in UIImageView, button pressed, displays image 2, button pressed again displays image 3, and so on until you get to image 5, once at image 5, if you press the button again, it will go back to the start (image 1).
I am so new that I would like some example code to help please, not to copy and paste but to study to see how it works, and how I can implement similar within my app.
I hope this makes sense. I’m not up with the lingo yet, so idiot proof advise would be good.
Ok I just whipped up some example for you here
Define in .h
and write these in .m
Do not follow my naming convention, it was an example. You should write it out nicely.
This should work once you put in the images. Let me know if you have a question but please do google before asking anything.