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
Copy file name to clipboardExpand all lines: README.md
+13-10Lines changed: 13 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,8 @@ Check this <a href="https://www.behance.net/gallery/20411445/Mobile-Animations-I
13
13
## Requirements
14
14
15
15
- iOS 7+
16
-
- Swift 4.2
17
-
- Xcode 9
16
+
- Swift 5
17
+
- Xcode 11
18
18
19
19
## Installation
20
20
@@ -23,7 +23,7 @@ Check this <a href="https://www.behance.net/gallery/20411445/Mobile-Animations-I
23
23
Simply add the following line to your Podfile:
24
24
25
25
```ruby
26
-
pod 'YALSideMenu', '~> 2.1'
26
+
pod 'YALSideMenu', '~> 2.0.1'
27
27
```
28
28
29
29
*(CocoaPods v1.1 or later is required)*
@@ -53,7 +53,7 @@ pod 'YALSideMenu', '~> 2.1'
53
53
54
54
```swift
55
55
class MyFancyMenuViewController: UIViewController, Menu {
56
-
@IBOutlet var menuItems = [UIView] ()
56
+
@IBOutlet var menuItems = [UIView] ()
57
57
}
58
58
```
59
59
@@ -63,25 +63,28 @@ pod 'YALSideMenu', '~> 2.1'
63
63
```swift
64
64
import SideMenu
65
65
class ContentViewController: UIViewController {
66
-
var menuAnimator : MenuTransitionAnimator!
66
+
var menuAnimator : MenuTransitionAnimator!
67
67
}
68
68
```
69
69
5. Initialize an animator for presentation with parameters
70
70
71
71
```swift
72
72
menuAnimator = MenuTransitionAnimator(mode: .presentation, shouldPassEventsOutsideMenu: false) { [unowned self] in
73
-
self.dismiss(animated: true, completion: nil)
73
+
self.dismiss(animated: true, completion: nil)
74
74
}
75
75
```
76
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
+
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.
78
+
79
+
It's possible to specify menu position starting from version `2.0.2`. To position menu on the left side you should pass `.left` to `position` in `MenuTransitionAnimator` init. To position menu on the right side - pass `.right` accordingly.
80
+
78
81
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