UserDefaults as common for entire app iOS swift

Solution:


In iOS it was easy to create a User default variable as common and get that in entire app.
First you have to declare a variable with any name of datatype Userdefaults in Appdelegate funcation at the top.

Then in didfinishlaunching initialize the variable and then use it in the entire app.

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift