Last active
August 29, 2015 14:06
-
-
Save designatednerd/759589d2965ba49f4e28 to your computer and use it in GitHub Desktop.
Struct Constants Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FOUNDATION_EXPORT const struct DNSUserDefaults { | |
__unsafe_unretained NSString *hasRunBefore; | |
__unsafe_unretained NSString *hasMadeInAppPurchase; | |
} DNSUserDefaults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import Constants.h | |
const struct DNSUserDefaults DNSUserDefaults = { | |
.hasRunBefore = @"kHasRunBefore", | |
.hasMadeInAppPurchase = @"kDidGiveMeMonies", | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import Constants.h | |
//In a method. | |
BOOL firstRun = ![[NSUserDefaults standardUserDefaults] boolForKey:DNSUserDefaults.hasRunBefore]; | |
BOOL areWeFriends = [[NSUserDefaults standardUserDefaults] boolForKey:DNSUserDefaults.hasMadeInAppPurchase]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment