Dynamic font change and font color changes in Iphone application
I have an application which get the settings values such as font color style etc from API.
The user can edit those values from web view and those need to be reflected in the APP.
Can any one suggest the bes开发者_运维问答t method to integrate with the app.??
My suggestion:
- Use a convenient JSON framework, such as stig's JSON-Framework.
- Get the info from the server in JSON format (obviously), via
NSURLConnection
(documentation here). - Assign the properties of your UI elements such as
textColor
,font
etc.
Seems doable - but based on the given information I would perhaps recommend to let your users do that from within the app. It would be much more intuitive.
EDIT: More specific implementation info.
You can simply use global variables. E.g., make a class Formats
which stores all the values you need, fetching and parsing them as necessary (lazily). Then, when you need certain formatting, just use code like
Formats *format = [[[Formats alloc] init] autorelease]; // or pass a reference
myNameTextField.textColor = [format textColorForNames];
精彩评论