You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configuring Left and Right menu for different Viewcontrollers
38
45
---------
46
+
You decide whether to enable or disable slide functionality on each viewController by implementing the following delegate methods of SlideNavigationControllerDelegate. These methods are optional, and if not implemented the menu functionality will be disabled for that particulat viewController.
@@ -56,34 +64,83 @@ Configuring Left and Right menu for different Viewcontrollers
56
64
@end
57
65
```
58
66
59
-
Configuring menu offset
67
+
Public properties
60
68
---------
61
-
Menu offset can be configured for both portrait and landscape mode
69
+
###### avoidSwitchingToSameClassViewController
70
+
Default value is set to YES.
71
+
If set to YES when switching to a new ViewController if the new viewcontroller is the same type as the current viewcontroller it'll close the menu instead of switching to the viewController.
72
+
73
+
If set to NO it'll switch to the viewController regardless of types
74
+
75
+
This can be usefull when you have a menu item, and when the user selects an already selected menu item you don't want to navigate to a new instance of the viewController
76
+
###### enableSwipeGesture
77
+
When set to YES user can swipe to open the menu
78
+
79
+
When set to NO swipe is disabled, and use can only open the menu using the UIBarButtonItem added to the navigationBar
80
+
###### rightMenu
81
+
The viewController of the right menu in the navigationController
82
+
###### leftMenu
83
+
The viewController of the left menu in the navigationController
84
+
###### leftBarButtonItem
85
+
Default value is null. When this button is set navigationController uses this UIBarButtonItem as the leftItem. this property is intended to be used when a custom UIBarButton is needed (UIBarButtonItem initialized with a custom view)
86
+
###### rightBarButtonItem
87
+
Behaves exactly the same as leftbarButtonItem, but it's used as the right button for the menu
88
+
###### portraitSlideOffset
89
+
Default value of portraitSlideOffset is 60. This means when the menu is open, the width of the visible portion of the navigation controller is 60 pixels in portrait mode
90
+
###### landscapeSlideOffset
91
+
Default value of portraitSlideOffset is 60. This means when the menu is open, the width of the visible portion of the navigation controller is 60 pixels in landscape mode
92
+
###### menuRevealAnimator
93
+
menuRevealAnimator is used to animate the left/right menu during reveal. The default value is nil that means no animations occure when opening/closing the menu.
94
+
95
+
There are existing animation that can be used out of the box. These animation classes can be configured through init method options.
There are three types of animations that can be applied when revealing the menu
109
+
SlideNavigationController allows custom reveal animations. In order to add custom animations create a new class implementing SlideNavigationContorllerAnimator protocol. For more information take a look at the existing animation classes.
This method gets called as the menu reveal occurs, and passes the progress to be used for animations(progress is between 0 and 1)
115
+
###### - (void)clear;
116
+
This method gets called if for any resons the instance of animator is being changed. For instance, the animator is changed from SlideNavigationContorllerAnimatorFade to SlideNavigationContorllerAnimatorSlide. In this method you should cleanup the state of the menu if neede. For instance if you added a view to the menu for reveal animation, you should remove it when clear gets called.
Pops to root ViewController, then pushes the new ViewController and finally calls the completion
78
124
79
-
The opacity applied during a fade animation can be configured using a property on SlideNavigationController called menuRevealAnimationFadeMaximumAlpha. This value can be anywhere between 0 and 1, and it represents the darkes a menu can become. The color of fade layer can also be configured using the property called menuRevealAnimationFadeColor
Closes the menu and calls the completion block oppon animation completion
84
130
85
-
The movement of menu during a slide animation can also be configured
131
+
###### - (void)toggleLeftMenu;
132
+
Toggles the left menu open or close depending on the existing state. This was made public in order to pass the selector to a custom UIBarButtonItem (ex: UIBarButtonItem with a button as a custom view)
0 commit comments