I need to let user navigate back and forward through different images (from 10 to 20) with a tap.
All the images are 1024×768 JPG’s so I don’t need to resize or transform them.
There are no animations between them (I’ll switch them with a removeFromSuperView and addSubView).
All I want is avoid loading time or unresponding touch, so I actually was thinking about these possible solutions:
- Load each image singularly on tap;
- Load 3 images: previous, actual and next one;
- Load an array or a uiviewimage with all the images and iterate through it;
I will avoid imageNamed and I’ll use imageWithContentOfFile or imageWithData.
Which solution do you think is the best one?
Could solutions 1. and 3. bring some performance issue?
Method 1 will be good : iOS devices can load full screen images really fast. Especially if your images don’t have alpha. It will depends on images but it takes around 0.05 seconds for a classic png. This means that users will not notice the waiting time if you have to change after a tap especially if you had a fade transition between images.
Things can get harder if user can scroll through images. In this case, I would advise to use UITableView. They behave like UISCrollView and they load/unload pages fastly and smoothly.
To get an horizontal table view, you can use this code which works perfectly : https://github.com/alekseyn/EasyTableView