NSUserDefaults+FLEX.m 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // NSUserDefaults+FLEX.m
  3. // FLEX
  4. //
  5. // Created by Tanner on 3/10/20.
  6. // Copyright © 2020 Flipboard. All rights reserved.
  7. //
  8. #import "NSUserDefaults+FLEX.h"
  9. static NSString * const kFLEXToolbarTopMarginKey = @"com.flex.FLEXToolbar.topMargin";
  10. static NSString * const kFLEXHideRedundantIvarsKey = @"com.flipboard.FLEX.hide_redundant_ivars";
  11. static NSString * const kFLEXHideRedundantMethodsKey = @"com.flipboard.FLEX.hide_redundant_methods";
  12. static NSString * const kFLEXiOSPersistentOSLogKey = @"com.flipborad.flex.enable_persistent_os_log";
  13. @implementation NSUserDefaults (FLEX)
  14. - (double)flex_toolbarTopMargin {
  15. if ([self objectForKey:kFLEXToolbarTopMarginKey]) {
  16. return [self doubleForKey:kFLEXToolbarTopMarginKey];
  17. }
  18. return 100;
  19. }
  20. - (void)setFlex_toolbarTopMargin:(double)margin {
  21. [self setDouble:margin forKey:kFLEXToolbarTopMarginKey];
  22. }
  23. - (BOOL)flex_cacheOSLogMessages {
  24. return [self boolForKey:kFLEXiOSPersistentOSLogKey];
  25. }
  26. - (void)setFlex_cacheOSLogMessages:(BOOL)cache {
  27. [self setBool:cache forKey:kFLEXiOSPersistentOSLogKey];
  28. }
  29. - (BOOL)flex_explorerHidesRedundantIvars {
  30. return [self boolForKey:kFLEXHideRedundantIvarsKey];
  31. }
  32. - (void)setFlex_explorerHidesRedundantIvars:(BOOL)hide {
  33. [self setBool:hide forKey:kFLEXHideRedundantIvarsKey];
  34. }
  35. - (BOOL)flex_explorerHidesRedundantMethods {
  36. return [self boolForKey:kFLEXHideRedundantMethodsKey];
  37. }
  38. - (void)setFlex_explorerHidesRedundantMethods:(BOOL)hide {
  39. [self setBool:hide forKey:kFLEXHideRedundantMethodsKey];
  40. }
  41. @end