Skip to content

Commit 0ec0cfa

Browse files
author
Olga Konoreva
authored
Merge pull request #24
Update README.md
2 parents 6ed7059 + eb9d50c commit 0ec0cfa

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,22 @@ It supports following customization:
1717

1818
All these parameters could vary for different orientations.
1919

20+
## Communication
21+
22+
- If you **need help or found a bug**, please, open an issue.
23+
- If you **have a feature request**, open an issue.
24+
- If you **are ready to contribute**, submit a pull request.
25+
- If you **like Interactive Side Menu**, please, give it a star.
26+
- If you **use Interactive Side Menu in your application published to AppStore**, [send us a link](https://github.com/handsomecode/InteractiveSideMenu/issues/new) and we'll create the list with applications used our library.
27+
2028
# Installation
2129

2230
## CocoaPods
2331
To install it through [CocoaPods](https://cocoapods.org/), add the following line to your Podfile:
2432
```
2533
pod 'InteractiveSideMenu'
2634
```
35+
Please, don't forget to run `pod update` command to update your local specs repository during migration from one version to another.
2736

2837
## Carthage
2938
To install it through [Carthage](https://github.com/Carthage/Carthage), add the following line to your Cartfile:
@@ -40,6 +49,7 @@ To implement your side menu you should create subclasses of basic View Controlle
4049
Also, ensure that every menu item ViewController adopts relevant protocol.
4150
- ```SideMenuItemContent``` is a ViewController's protocol for data that corresponds menu item
4251

52+
## HostViewController implementation
4353
To setup your side menu you need to do three things:
4454
- Provide implementation of base ```MenuViewController``` and assing it to ```menuViewController``` property
4555
- Provide implementation of menu content and assing array of content controllers to ```contentViewControllers``` property
@@ -66,6 +76,7 @@ class HostViewController: MenuContainerViewController {
6676
}
6777
```
6878

79+
## Items content
6980
To show menu, call ```showSideMenu()``` method from `SideMenuItemContent` protocol.
7081
```swift
7182
import InteractiveSideMenu
@@ -80,13 +91,32 @@ class KittyViewController: UIViewController, SideMenuItemContent {
8091

8192
To change content view, choose desired content controller and hide menu.
8293
```swift
83-
let index = 2 // second menu item
94+
let index = 2 // Second menu item
8495
guard let menuContainerViewController = self.menuContainerViewController else { return }
8596
let contentController = menuContainerViewController.contentViewControllers[index]
8697
menuContainerViewController.selectContentViewController(contentController)
87-
menuContainerViewController.hideMenu()
98+
menuContainerViewController.hideSideMenu()
8899
```
100+
101+
### TabBar and Navigation controllers
102+
103+
To use menu with **TabBar** or **NavigationController**, ensure that you indicate UITabBarController or UINavigationController as item content directly, not any corresponding ViewControllers.
104+
```swift
105+
class NavigationViewController: UINavigationController, SideMenuItemContent {
106+
}
89107

108+
class InnerViewController: UIViewController {
109+
110+
@IBAction func openMenu(_ sender: Any) {
111+
if let navigationViewController = self.navigationController as? SideMenuItemContent {
112+
navigationViewController.showSideMenu()
113+
}
114+
}
115+
}
116+
```
117+
Please, find UITabBarController implementation details in [Sample](./Sample).
118+
119+
## Animation Customization
90120
To customize animation for menu opening or closing, update ```transitionOptions``` property that is available in ```MenuContainerViewColtroller``` class. Initial setup could be done, for example, on controller's ```viewDidLoad()```.
91121
```swift
92122
override func viewDidLoad() {

0 commit comments

Comments
 (0)