|
@@ -5,23 +5,37 @@
|
5
|
5
|
|
6
|
6
|
- (void)applyOnSide:(MMDrawerSide)side viewController:(UIViewController *)viewController {
|
7
|
7
|
RNNSideMenuController* sideMenuController = (RNNSideMenuController*)UIApplication.sharedApplication.delegate.window.rootViewController;
|
8
|
|
- if (self.enabled) {
|
9
|
|
- switch (side) {
|
10
|
|
- case MMDrawerSideRight:
|
11
|
|
- sideMenuController.sideMenu.rightSideEnabled = [self.enabled boolValue];
|
12
|
|
- break;
|
13
|
|
- case MMDrawerSideLeft:
|
14
|
|
- sideMenuController.sideMenu.leftSideEnabled = [self.enabled boolValue];
|
15
|
|
- default:
|
16
|
|
- break;
|
|
8
|
+ if (sideMenuController && [sideMenuController isKindOfClass:[RNNSideMenuController class]]) {
|
|
9
|
+ if (self.enabled) {
|
|
10
|
+ switch (side) {
|
|
11
|
+ case MMDrawerSideRight:
|
|
12
|
+ sideMenuController.sideMenu.rightSideEnabled = [self.enabled boolValue];
|
|
13
|
+ break;
|
|
14
|
+ case MMDrawerSideLeft:
|
|
15
|
+ sideMenuController.sideMenu.leftSideEnabled = [self.enabled boolValue];
|
|
16
|
+ default:
|
|
17
|
+ break;
|
|
18
|
+ }
|
17
|
19
|
}
|
18
|
|
- }
|
19
|
|
-
|
20
|
|
- if (self.visible) {
|
21
|
|
- if (self.visible.boolValue) {
|
22
|
|
- [sideMenuController showSideMenu:side animated:YES];
|
23
|
|
- } else {
|
24
|
|
- [sideMenuController hideSideMenu:side animated:YES];
|
|
20
|
+
|
|
21
|
+ if (self.visible) {
|
|
22
|
+ if (self.visible.boolValue) {
|
|
23
|
+ [sideMenuController showSideMenu:side animated:YES];
|
|
24
|
+ } else {
|
|
25
|
+ [sideMenuController hideSideMenu:side animated:YES];
|
|
26
|
+ }
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+ if (self.width) {
|
|
30
|
+ switch (side) {
|
|
31
|
+ case MMDrawerSideRight:
|
|
32
|
+ sideMenuController.sideMenu.maximumRightDrawerWidth = self.width.floatValue;
|
|
33
|
+ break;
|
|
34
|
+ case MMDrawerSideLeft:
|
|
35
|
+ sideMenuController.sideMenu.maximumLeftDrawerWidth = self.width.floatValue;
|
|
36
|
+ default:
|
|
37
|
+ break;
|
|
38
|
+ }
|
25
|
39
|
}
|
26
|
40
|
}
|
27
|
41
|
|