Skip to content

Commit 8aeedde

Browse files
author
Anna Sahaidak
committed
Update Readme file
1 parent 24fefe2 commit 8aeedde

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Check this <a href="https://www.behance.net/gallery/20411445/Mobile-Animations-I
1313
## Requirements
1414

1515
- iOS 7+
16-
- Swift 4.2
17-
- Xcode 9
16+
- Swift 5
17+
- Xcode 11
1818

1919
## Installation
2020

@@ -23,7 +23,7 @@ Check this <a href="https://www.behance.net/gallery/20411445/Mobile-Animations-I
2323
Simply add the following line to your Podfile:
2424

2525
```ruby
26-
pod 'YALSideMenu', '~> 2.1'
26+
pod 'YALSideMenu', '~> 2.0.1'
2727
```
2828

2929
*(CocoaPods v1.1 or later is required)*
@@ -53,7 +53,7 @@ pod 'YALSideMenu', '~> 2.1'
5353

5454
```swift
5555
class MyFancyMenuViewController: UIViewController, Menu {
56-
@IBOutlet var menuItems = [UIView] ()
56+
@IBOutlet var menuItems = [UIView] ()
5757
}
5858
```
5959

@@ -63,25 +63,28 @@ pod 'YALSideMenu', '~> 2.1'
6363
```swift
6464
import SideMenu
6565
class ContentViewController: UIViewController {
66-
var menuAnimator : MenuTransitionAnimator!
66+
var menuAnimator : MenuTransitionAnimator!
6767
}
6868
```
6969
5. Initialize an animator for presentation with parameters
7070

7171
```swift
7272
menuAnimator = MenuTransitionAnimator(mode: .presentation, shouldPassEventsOutsideMenu: false) { [unowned self] in
73-
self.dismiss(animated: true, completion: nil)
73+
self.dismiss(animated: true, completion: nil)
7474
}
7575
```
7676

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+
7881
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.
7982

8083
```swift
8184
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
82-
let menu = segue.destination as! MenuViewController
83-
menu.transitioningDelegate = self
84-
menu.modalPresentationStyle = .custom
85+
let menu = segue.destination as! MenuViewController
86+
menu.transitioningDelegate = self
87+
menu.modalPresentationStyle = .custom
8588
}
8689

8790
func animationController(forPresented presented: UIViewController, presenting _: UIViewController,

0 commit comments

Comments
 (0)