How to set UserDefault Key Value from Launch Argument?

This is the best hidden feature of UserDefaults. If you pass a UserDefault key and value as a launch argument this will set new value for that key. You can use this trick to override current value for any key. This will help you a lot in debugging.

Here the screen-shot for above key -

Share this

Join

Search articles

Search titles, tags and article content.

    You've successfully subscribed to Developer Insider
    Your account is ready. Welcome to Developer Insider
    Welcome back! You've successfully signed in
    Success! Your account is fully activated, you now have access to all content.