Reputation: 24922
I have application wide config variables such as mixpanel token, twillio access token, etc. that currently I am storing as global constants in my AppDelegate. Is there a better to put thesee?
// TODO: Is there a better place to put these?
let appId = 1.....2
let contactUsPhoneNumber = +17.......2
let mixpanelToken = "1..............2"
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
...
}
Some options I have considered:
Anything else I am missing?
Upvotes: 0
Views: 294
Reputation: 535304
Ideally keep these values in some class or struct that makes sense to own them. If there really is no such thing, then at least namespace them by declaring them as static let
instance properties of an enum or struct. Do not let them "float free" as in your example code.
Upvotes: 1