I want to store the presentation data about my application which is retrieved from a remote server. Presentation data will include the text color,size, placement of controls etc of each and every screen(viewcontroller) of my iOS app. The presentation data will be accessed from every single screen to actually render the page itself.
Does Singleton Pattern qualifies for this situation? I’m concerned about the memory warnings and performance here.
Thanks for the help.
I think you’re headed in the right direction, but don’t get caught up in terminology.
You do want to encapsulate the data by making it available by either a static method on a known class or by an instance method of a singleton class. In this case you’re using the Singleton not for the data itself, but for a class whose instance provides access to the data.
Once you have that method defined, you can consider performance enhancements like lazy-initialization, caching and, as lapatus suggests, file storage if the data is really big.