I am currently developing a weather app.
For now I have just implemented static background image on the Home page that vary depending on the current weather.
I would like to improve this feature in order to provide a better user experience.
I think that with the rapid growth of technology, hardware, wifi but even frameworks and developing tools we are able to make greater and greater Apps each days.
That's why I am really interested about knowing different ways to improve my App.
Moreover, I think that the proper/coolest way to differentiate my App from the weather-app market is to have unique features or at least "more enjoyable" than others.
I really don't know where to start, I have read 3 different posts on StackOverflow about animated background without success.
I would like to know which solution is better in order to implement animated background image.
PS: I am developing with Objective C.
If you have any suggestions, any informations, I'll take it.
Thank you in advance.
There is a way to create a continuously animated image. What you do is create a UIImage with a special initializer (see final line). You give this initializer the base name of an image, like “storm”. The understanding is that you will have several files named storm1.png, storm2.png, etc., the succession of which will constitute an animation. All you do is call the initializer and specify how long you’d like each animation frame to last, and all the rest is automatic. The image view that gets created will continue cycling through however many animation frames you have. As long as that image view is visible, Apple’s code will guarantee the image will be continuously animating. As soon as it gets to the end of the list (say, storm8 if you have 8 frames in your animation), it automatically starts over. At least in Swift, you don’t even have to tell it the file extension of the images.
If you want the image to cover the entire background of your view controller, just set up the imageView in Interface Builder to be pinned to the left, right, top, and bottom of the main view of your view controller.
Here’s the syntax for creating the continuously animated image in your code:
UIImage *image = [UIImage animatedImageNamed:@"storm.jpg" duration:0.5f];
Or in Swift:
let imageView.image = UIImage.animatedImageNamed("storm", duration: 0.5)