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
- iOS 7.x / 8.x / 9.x (see installation instructions)
15
+
- iOS 7+
16
16
- Swift 3
17
17
- Xcode 8
18
18
19
-
##Installation
19
+
##Installation
20
20
21
-
####Using [CocoaPods](http://cocoapods.org)
21
+
####Using [CocoaPods](http://cocoapods.org)
22
22
23
23
Simply add the following line to your Podfile:
24
24
25
25
```ruby
26
26
pod 'YALSideMenu', '~> 2.0'
27
27
```
28
28
29
-
*(CocoaPods v0.36 or later required. See [this blog post](http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/) for details.)*
29
+
*(CocoaPods v1.1 or later is required)*
30
30
31
-
####Manual Installation
31
+
####Manual Installation
32
32
33
33
> For application targets that do not support embedded frameworks, such as iOS 7, SideMenu can be integrated by including source files from the SideMenu folder directly, optionally wrapping the top-level types into `struct SideMenu` to simulate a namespace. Yes, this sucks.
34
34
@@ -41,7 +41,7 @@ pod 'YALSideMenu', '~> 2.0'
41
41
7. Expand the "Link Binary With Libraries" group, and add `SideMenu.framework`
42
42
8. Click on the `+` button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add `SideMenu.framework`.
43
43
44
-
##Usage
44
+
##Usage
45
45
46
46
1. Import `SideMenu` module
47
47
@@ -60,20 +60,21 @@ pod 'YALSideMenu', '~> 2.0'
60
60
3. Set `preferredContentSize` in menu view controller to specify the desired menu width
61
61
4. In content view controller store an animator, that will animate our menu.
62
62
63
-
```swift
64
-
importSideMenu
65
-
classContentViewController: UIViewController {
66
-
var menuAnimator : MenuTransitionAnimator!
67
-
}
68
-
```
63
+
```swift
64
+
import SideMenu
65
+
class ContentViewController: UIViewController {
66
+
var menuAnimator : MenuTransitionAnimator!
67
+
}
68
+
```
69
69
5. Initialize an animator for presentation with parameters
70
70
71
-
```swift
72
-
menuAnimator =MenuTransitionAnimator(mode: .presentation, shouldPassEventsOutsideMenu: false) { [unownedself] in
71
+
```swift
72
+
menuAnimator = MenuTransitionAnimator(mode: .presentation, shouldPassEventsOutsideMenu: false) { [unowned self] in
73
73
self.dismiss(animated: true, completion: nil)
74
-
}
75
-
```
76
-
If you want, for example, to dismiss your menu when a tap outside menu takes place, you should pass 'false' to 'shouldPassEventsOutsideMenu' flag and assign a 'tappedOutsideHandler'.In fact, you are free to do whatever you want when a tap outside menu occurs or, if you want to have access to your content view controller, just pass 'true' and assign 'tappedOutsideHandler' to nil.
74
+
}
75
+
```
76
+
77
+
If you want, for example, to dismiss your menu when a tap outside menu takes place, you should pass 'false' to 'shouldPassEventsOutsideMenu' flag and assign a 'tappedOutsideHandler'.In fact, you are free to do whatever you want when a tap outside menu occurs or, if you want to have access to your content view controller, just pass 'true' and assign 'tappedOutsideHandler' to nil.
77
78
6. Implement class of UIViewControllerTransitioningDelegate that will return our menuAnimator from method animationControllerForPresentedController and assign it to transitioningDelegate of menu view controller(Don't forget to set .Custom modal presentation style). To dismiss menu you should return MenuTransitionAnimator(mode: .Dismissal) from animationControllerForDismissedController method.
0 commit comments