-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRZAppDelegate.m
More file actions
59 lines (43 loc) · 2.45 KB
/
RZAppDelegate.m
File metadata and controls
59 lines (43 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// RZAppDelegate.m
// RZDebugMenuDemo
//
// Created by Clayton Rieck on 6/2/14.
// Copyright (c) 2014 Raizlabs. All rights reserved.
//
#import "RZAppDelegate.h"
#import "RZDebugMenuRootViewController.h"
#import <RZDebugMenu/RZDebugMenu.h>
#import <RZDebugMenu/RZDebugMenuSettings.h>
#import <RZDebugMenu/RZDebugMenuUserDefaultsStore.h>
static NSString *const kSettingsPlistName = @"Settings.plist";
@implementation RZAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if (DEBUG)
// To activate the debug menu, call this method with the name of the settings plist you want to use. It should be included in your application bundle.
[RZDebugMenu enableMenuWithSettingsPlistName:kSettingsPlistName];
#endif
RZDebugMenuRootViewController *rootViewController = [[RZDebugMenuRootViewController alloc] init];
UINavigationController *rootNavigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = rootNavigationController;
[self.window makeKeyAndVisible];
#if (DEBUG)
// To configure automatic show and hide of the debug menu via a 4-tap gesture, call this method with your app's primary window.
[[RZDebugMenu sharedDebugMenu] configureAutomaticShowHideOnWindow:self.window];
// The debug menu button will be hidden by default. To show it, call the above method and then do the 4-tap gesture, or you can enable it programmatically as follows.
[RZDebugMenu sharedDebugMenu].showDebugMenuButton = YES;
// If you want your settings to be stored directly in user defaults, overwriting values used by your app via regular defaults APIs, you can uncomment the line below.
// [[RZDebugMenuSettings sharedSettings] setDebugSettingsStoreClass:[RZDebugMenuUserDefaultsStore class]];
// For general observation of changes to any debug settings, you can use this notification, which includes specific information on what setting changes, as well as the previous and new values.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(settingsChanged:) name:kRZDebugMenuSettingChangedNotification object:nil];
#endif
return YES;
}
- (void)settingsChanged:(NSNotification *)note
{
NSLog(@"Settings changed: %@.", note);
}
@end