I want to create a custom banner view which will display banners from my own web service and rotate them every second. The view will be shown on every page of the app.
When the app starts it will call my service to check if there are any new banners available and download them otherwise will pick the banners from the local cache directory.
I am confused in what classes should i create so that it fits in the MVC as well as its generic so that i can use it on every page without rewriting the code?
After quite a long thought process… i implemented it by having
A
BannerViewclass, a subclass ofUIImageView, which had click gestures as well as an UIImage array which would animate.For Model i used a singleton
BannerManagerclass which would download files from internet, save them in documents directory and also their links in the user defaults. It also had array ofUIImageIn every controller i used the same setup method, which would first get the shared instance of the model, and then set assign its banners array to views banner array