Where to store global constants in an iOS application?

后端 未结 11 1670
孤城傲影
孤城傲影 2020-11-28 18:01

Most of the models in my iOS app query a web server. I would like to have a configuration file storing the base URL of the server. It will look something like this:

11条回答
  •  悲&欢浪女
    2020-11-28 18:15

    I'd use a configuration object that initializes from a plist. Why bother other classes with irrelevant external stuff?

    I created eppz!settigns soley for this reason. See article Advanced yet simple way to save to NSUserDefaults for incorporating default values from a plist.

    enter image description here

提交回复
热议问题