Code Monkey home page Code Monkey logo

side-menu.ios's Introduction

Side Menu

Platform License

Animated side menu with customizable UI. Made in Yalantis.
Check this project on dribbble.
Check this project on Behance.

Requirements

  • iOS 7+
  • Swift 5
  • Xcode 11

Installation

Using CocoaPods

Simply add the following line to your Podfile:

pod 'YALSideMenu', '~> 2.0.1'

(CocoaPods v1.1 or later is required)

Manual Installation

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.

  1. Add SideMenu as a submodule by opening the Terminal, cd-ing into your top-level project directory, and entering the command git submodule add https://github.com/yalantis/Side-Menu.iOS.git
  2. Open the SideMenu folder, and drag SideMenu.xcodeproj into the file navigator of your app project.
  3. In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar.
  4. Ensure that the deployment target of SideMenu.framework matches that of the application target.
  5. In the tab bar at the top of that window, open the "Build Phases" panel.
  6. Expand the "Target Dependencies" group, and add SideMenu.framework.
  7. Expand the "Link Binary With Libraries" group, and add SideMenu.framework
  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.

Usage

  1. Import SideMenu module

    import SideMenu
  2. Adopt the Menu protocol in your menu view controller, e.g.

    class MyFancyMenuViewController: UIViewController, Menu  {
        @IBOutlet var menuItems = [UIView] ()
    }
  3. Set preferredContentSize in menu view controller to specify the desired menu width

  4. In content view controller store an animator, that will animate our menu.

    import SideMenu
    class ContentViewController: UIViewController  {
        var menuAnimator : MenuTransitionAnimator!
    }
  5. Initialize an animator for presentation with parameters

    menuAnimator = MenuTransitionAnimator(mode: .presentation, shouldPassEventsOutsideMenu: false) { [unowned self] in
        self.dismiss(animated: true, completion: nil)
    }

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.

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.

  1. 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.

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        let menu = segue.destination as! MenuViewController
        menu.transitioningDelegate = self
        menu.modalPresentationStyle = .custom
    }
    
    func animationController(forPresented presented: UIViewController, presenting _: UIViewController,
        source _: UIViewController) -> UIViewControllerAnimatedTransitioning? {
            return menuAnimator
    }
    
    func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return MenuTransitionAnimator(mode: .dismissal)
    }

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!

License

The MIT License (MIT)

Copyright © 2018 Yalantis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

side-menu.ios's People

Contributors

aeugene avatar andrewios avatar edbaev avatar egorsobko avatar maximletushov avatar mrcompoteee avatar pauliusvindzigelskis avatar pravdaevgen avatar rnkyr avatar serejahh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

side-menu.ios's Issues

How to use this without a storyboard?

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

the MenuExample can't run

When I click the menu button,Xcode tell me the error:
assertion failed: Destination must conform to SideMenu.Menu protocol: file /Users/aofel/Downloads/Side-Menu.iOS-master/SideMenu/MenuSegue.swift, line 14

No such module "SideMenu"

Hi ,
I am new in swift, i tried to use your Side-Menu.IOS, i follow all the steps but when i import SideMenu, it show me error- "No Such Module SideMenu". I am using ios 9 and Xcode 7.2.
I tried to set Framework Search Path , but its not work because the framework show different path when i see its path in inspector. It show me path -"/Users/element45/Library/Developer/Xcode/DerivedData/sideMenuExample-frlseoygwmkbgyavakwulipeqlda/Build/Products/Debug-iphoneos/SideMenu.framework".
when i check on terminal i don't get the folder Debug-iphoneos.

it can be used with dynamic ui tableview?

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

Xcode Error: No such module SideMenu

upon adding 'import SideMenu' in the view controller just after import UIKit (as per instructions) Xcode shows error 'No such module SideMenu'. Grateful for feedback.

Crashing when push to another controller

Menu is working fine but when i push from main screen to another controller
CircularRevealTransitionAnimator crashes bcoz it not been initialised found nil until we move to another screen of the through menu.
Once we move to another menu screen through menu it work fine
i have a case when user move to another screen from main screen without opening the menu.It crashed
Pls provide a solution
screen shot 2016-03-31 at 11 55 40 am

I want to use this library on OC, please advise

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

As! instead of As

According to new Swift standards, we should use 'as!' instead of 'as' for casting. You can just replace 'as' with 'as!' for all occurrences.

Exists a way to close the menu tapping outside the menu?

Im working on a an app for events, and im using your library to show up a simple side menu, but, as the menu doesn't cover all screen, i need to dismiss the menu just by tapping anywhere(area outside the menu can be overlayed by a kind of translucent black or something) outside the menu or just tapping over cancel button

help?

this is by far the best thing i saw .. i swear to god its amazing .. the thing is am new to swift like i dont understand anything from the usage i know cocoapods and i installed it but i cant get the side menu to work

it do not support right side menu instead of left direction ?

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

Doesn't work if first viewcontroller is child of navigationcontroller

# Report a bug :

I have a navigationController at the beginning. On adding menu button on the navigationController's first viewController, the animation takes place in a full screen.
The example shown makes a simple viewController as the first viewController.

# Expectations :

It should behave in the same way as it does in a simple viewController

## What happened instead?

Attached screenshot :

screen shot 2017-12-25 at 10 59 33 pm
screen shot 2017-12-25 at 10 59 39 pm


To confirm, I used menu button in another viewController(which was not embedded in UINavigationController), and it worked fine.

### Your Environment

  • Version of the component: insert here
  • Swift version: 4.0.3
  • iOS version: 11.2
  • Device: iPhone 5s
  • Xcode version: 9.2

I ran the latest pods in my project

Enable Scroll

Hello,
How I can enable the scroll for menu? Because in my case the last cell is displayed only half so I want to enable the scroll for that.

Thank you

help?

this is by far the best thing i saw .. i swear to god its amazing .. the thing is am new to swift like i dont understand anything from the usage i know cocoapods and i installed it but i cant get the side menu to work

Forces override on UIViewControllerAnimatedTransitioning methods then crashes

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

Report a bug

What did you do?

I tried to make delegate methods as your documentation says, but it forces me to add 'override' to each of the two methods. When I do, it runs but crashes. When I leave out both methods it does the same.

What did you expect to happen?

I expected the menu to pop up like in the demo project (which had no errors). I even tried to copy the classes from the demo but they have errors when I add them to my project.

What happened instead?

It crashed & has this error: Redundant conformance of 'ViewController' to protocol 'UIViewControllerTransitioningDelegate'

Your Environment

  • Version of the component: 2.0 & 2.0.1
  • Swift version: 3.0
  • iOS version: 10.3
  • Device: iPhone 7 Simulator
  • Xcode version: 8.3.2
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

n/a

Error !!

Hi Mr Dmytro

I try to open your Example codes, it's really not working it can not find This file "UIImage+Autoresize.h"

Can you explain how to fix it ?

Report

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

import sidemenu --- No such module 'SideMenu'

screen shot 2017-03-12 at 6 07 29 pm

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

Not support iPad?

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

support RTL Langauges ?

my application support arabic langauge , so i need to show the menu from right direction
not from left direction . is this possible ??

Incorrect version in installation instructions for cocoapods

Installation instructions in README.md, specify

pod 'YALSideMenu', '~> 2.1'

meanwhile the highest version available on cocoapods is 2.0.1:

$ pod search YALSideMenu

YALSideMenu (2.0.1)
   Animated side menu with customizable UI
   pod 'YALSideMenu', '~> 2.0.1'
   - Homepage: https://github.com/Yalantis/Side-Menu.iOS
   - Source:   https://github.com/Yalantis/Side-Menu.iOS.git
   - Versions: 2.0.1, 2.0, 1.2.0, 1.1.0, 1.0 [master repo]

Based on list of releases (https://github.com/Yalantis/Side-Menu.iOS/releases) I conclude that instructions simply incorrect, and not that version is missing.

in swift 4 .sidemenu animation how to do that..

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

side menu animation exactly what your showing in your image

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

Swift 2.3

Hello,

First of all, thanks for provide us all this stuff. You save us a lot of hours.

I am using Swift 2.3 so I have followed steps in branch 2.3, but when I add throw CocoaPods
pod 'YALSideMenu', when I open the app in XCode I get a bunch of errors (arround 30). I don´t know if I´m doing something wrong or what is happening. I would really apreciate if you could help me.

Thanks in advance!!

Menu example not working

Hi,
I recently cloned the repo and was trying to play with menuexample. I also followed ur instructions on manual installation, to the word as mentioned on your repository. But yet, i am facing following issues:
2015-04-30 18:40:45.550 MenuExample[61607:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UITableViewCell 0x7ff6e0c69540> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key layoutMargins.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000105865495 exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001073d199e objc_exception_throw + 43
2 CoreFoundation 0x00000001058e9919 -[NSException raise] + 9
3 Foundation 0x0000000105d59530 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 UIKit 0x0000000106446569 -[UIView(CALayerDelegate) setValue:forKey:] + 149
5 CoreFoundation 0x0000000105861400 -[NSArray makeObjectsPerformSelector:] + 224
6 UIKit 0x0000000106641893 -[UINib instantiateWithOwner:options:] + 1112
7 UIKit 0x00000001064dbb0c -[UIViewController _loadViewFromNibNamed:bundle:] + 245
8 UIKit 0x00000001064dc149 -[UIViewController loadView] + 112
9 UIKit 0x000000010665c646 -[UITableViewController loadView] + 77
10 UIKit 0x00000001064dc3b7 -[UIViewController loadViewIfRequired] + 75
11 UIKit 0x00000001064dc777 -[UIViewController view] + 29
12 UIKit 0x00000001064ea11a -[UIViewController shouldAutorotate] + 30
13 UIKit 0x00000001064ea402 -[UIViewController _preferredInterfaceOrientationForPresentationInWindow:fromInterfaceOrientation:] + 236
14 UIKit 0x0000000106738519 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:animation:] + 1798
15 UIKit 0x00000001064e6fce -[UIViewController presentViewController:withTransition:completion:] + 4854
16 SideMenu 0x000000010576af36 TFC8SideMenu9MenuSegue7performfS0_FT_T + 1270
17 SideMenu 0x000000010576b082 TToFC8SideMenu9MenuSegue7performfS0_FT_T + 34
18 UIKit 0x00000001063e7f06 -[UIApplication sendAction:to:from:forEvent:] + 80
19 UIKit 0x00000001063e7eb4 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 17
20 UIKit 0x00000001064c4880 -[UIControl _sendActionsForEvents:withEvent:] + 203
21 UIKit 0x00000001064c3dc0 -[UIControl touchesEnded:withEvent:] + 530
22 UIKit 0x000000010641ed05 -[UIWindow _sendTouchesForEvent:] + 701
23 UIKit 0x000000010641f6e4 -[UIWindow sendEvent:] + 925
24 UIKit 0x00000001063f729a -[UIApplication sendEvent:] + 211
25 UIKit 0x00000001063e4aed _UIApplicationHandleEventQueue + 9579
26 CoreFoundation 0x00000001057f4d21 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
+ 17
27 CoreFoundation 0x00000001057f45f2 __CFRunLoopDoSources0 + 242
28 CoreFoundation 0x000000010581046f __CFRunLoopRun + 767
29 CoreFoundation 0x000000010580fd83 CFRunLoopRunSpecific + 467
30 GraphicsServices 0x0000000108bddf04 GSEventRunModal + 161
31 UIKit 0x00000001063e6e33 UIApplicationMain + 1010
32 MenuExample 0x00000001056d2c3e top_level_code + 78
33 MenuExample 0x00000001056d2c7a main + 42
34 libdyld.dylib 0x0000000107d1d5fd start + 1
35 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Quick: note i am new to swift and trying to see if i can run the example and then use this control in an objective C project. Can you please help me, this is quite urgent, since my client has used android version of this control for their android app and they prefer to use this in the iOS app as well.

getting exception when i click on menu button

hi

i'm getting exception when i click on menu button, i followed all manual installation please help me

MenuExample[1050:25994] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a segue class named '_TtC8SideMenu9MenuSegue''
*** First throw call stack:
(
0 CoreFoundation 0x002a3946 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x020d5a97 objc_exception_throw + 44
2 UIKit 0x015299dc -[UIStoryboardSegueTemplate segueWithDestinationViewController:] + 0
3 UIKit 0x01529a02 -[UIStoryboardSegueTemplate segueWithDestinationViewController:] + 38
4 UIKit 0x01529ade -[UIStoryboardSegueTemplate _perform:] + 110
5 UIKit 0x01529bc5 -[UIStoryboardSegueTemplate perform:] + 116
6 libobjc.A.dylib 0x020eb7cd -[NSObject performSelector:withObject:withObject:] + 84
7 UIKit 0x00f0e23d -[UIApplication sendAction:to:from:forEvent:] + 99
8 UIKit 0x00f0e1cf -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
9 UIKit 0x01041e86 -[UIControl sendAction:to:forEvent:] + 69
10 UIKit 0x010422a3 -[UIControl _sendActionsForEvents:withEvent:] + 598
11 UIKit 0x0104150d -[UIControl touchesEnded:withEvent:] + 660
12 UIKit 0x00f5e60a -[UIWindow _sendTouchesForEvent:] + 874
13 UIKit 0x00f5f0e5 -[UIWindow sendEvent:] + 791
14 UIKit 0x00f24549 -[UIApplication sendEvent:] + 242
15 UIKit 0x00f3437e _UIApplicationHandleEventFromQueueEvent + 20690
16 UIKit 0x00f08b19 _UIApplicationHandleEventQueue + 2206
17 CoreFoundation 0x001c71df CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15
18 CoreFoundation 0x001bcced __CFRunLoopDoSources0 + 253
19 CoreFoundation 0x001bc248 __CFRunLoopRun + 952
20 CoreFoundation 0x001bbbcb CFRunLoopRunSpecific + 443
21 CoreFoundation 0x001bb9fb CFRunLoopRunInMode + 123
22 GraphicsServices 0x04b7b24f GSEventRunModal + 192
23 GraphicsServices 0x04b7b08c GSEventRun + 104
24 UIKit 0x00f0c8b6 UIApplicationMain + 1526
25 MenuExample 0x000a6aee top_level_code + 78
26 MenuExample 0x000a6b2b main + 43
27 libdyld.dylib 0x02842ac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Side Menu Not Appearing???

I believe I have followed the whole setup process but for some reason, the side menu does not appear. In the post I will have a picture of my storyboard as well as all my view controllers code:

Main.storyboard:
screen shot 2017-02-26 at 5 33 04 pm

My content view controller:

class UserGroupsMainViewController: UITableViewController {

    
}

My menu view controller:

protocol MenuViewControllerDelegate: class {
    
    func menu(_ menu: MenuViewController, didSelectItemAt index: Int, at point: CGPoint)
    func menuDidCancel(_ menu: MenuViewController)
}

class MenuViewController: UITableViewController{
    
    weak var delegate: MenuViewControllerDelegate?
    var selectedItem = 0
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        let indexPath = IndexPath(row: selectedItem, section: 0)
        tableView.selectRow(at: indexPath, animated: false, scrollPosition: .none)
    }
}

extension MenuViewController {
    
    @IBAction fileprivate func dismissMenu() {
        delegate?.menuDidCancel(self)
    }
}

//MARK: Menu protocol
extension MenuViewController: Menu {
    
    var menuItems: [UIView] {
        return [tableView.tableHeaderView!] + tableView.visibleCells
    }
}

extension MenuViewController {
    
    override func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? {
        return indexPath == tableView.indexPathForSelectedRow ? nil : indexPath
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let rect = tableView.rectForRow(at: indexPath)
        var point = CGPoint(x: rect.midX, y: rect.midY)
        point = tableView.convert(point, to: nil)
        delegate?.menu(self, didSelectItemAt: indexPath.row, at: point)
    }
}

My View Controller (The one that is embedded with the navigation controller through a segue):

class MenuHelper: UIViewController, UIViewControllerTransitioningDelegate {
    
    lazy fileprivate var menuAnimator : MenuTransitionAnimator! = MenuTransitionAnimator(mode: .presentation, shouldPassEventsOutsideMenu: false) { [unowned self] in
        self.dismiss(animated: true, completion: nil)
    }
    
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        switch (segue.identifier, segue.destination) {
        case (.some("presentMenu"), let menu as MenuViewController):
            menu.transitioningDelegate = self
            menu.modalPresentationStyle = .custom
            menu.modalPresentationStyle = .custom
        case (.some("embedNavigator"), let navigator as UINavigationController):
            navigator.transitioningDelegate = self
            navigator.modalPresentationStyle = .custom
        default:
            super.prepare(for: segue, sender: sender)
        }
    }
    
    func animationController(forPresented presented: UIViewController, presenting _: UIViewController,
                             source _: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return menuAnimator
    }
    
    func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return MenuTransitionAnimator(mode: .dismissal)
    }

 
}

For some reason when the hamburger icon is clicked nothing happens. I don't know why and any help would be appreciated. Please ask any questions you may have.

Is it possible for Xcode 9.3 with swift 4

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

Support Swift 3

I got this error in my pod project.

/Library/Developer/Xcode/DerivedData/Test-brtdskyfgtyqulfxwzmaflpehpwc/Build/Products/Debug-iphonesimulator/YALSideMenu/SideMenu.framework/SideMenu compiled with older version of Swift language (2.0) than previous files (3.0) for architecture x86_64

Can you create new version for swift 3?
Or you already created it?

Thanks for creating such a great library.

Better documentation

Please support the rewriting of the documentation for this repository. It would be useful to many people that cannot digest all of the framework requirements just from the example project.

Side Menu: Content view tapped

Hi,
Thanks for your nice work, i would like to use the slide menu in my app, but needs to know how to handle a tap event on the Content view?

Thanks for your feedback.

How to show AlertViewController?

Report a bug

I can't show AlertViewController on navigator object.

What did you do?

I tried all different options to get the viewcontroller from uinavigationcontroller and navigator object but its not working.

What did you expect to happen?

It should show the alert on the screen.

What happened instead?

Nothing happened.

SideMenu is not presented in iOS 9.3, X-Code - 9

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here swift 3.0
  • iOS version: insert here 9.3
  • Device: insert here Simulator
  • Xcode version: insert here 9.0
  • If you use Cocoapods: run pod env | pbcopy and insert here cocoa pods
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

MenuAnimationSuccess.zip

Please add a link to a project we can download that reproduces the bug.

Side menu + Navigation bar

Hi,

First, have a great year.
Nice side menu, like all your other work, it is AMAZING!
Is there any way i can use this with a navigation bar?
Because i would appreciate it and would like to use it with it.

Thanks in advance,
Eliott Hauteclair

I updated to Swift 3, and now my menu disappears before completing dismissal animation.

In this video, I display the bug in action. There really isn't much code to show. It's basically textbook the way you describe to implement this. It worked perfectly before Swift 3.

https://streamable.com/ac6t

Your Environment

  • Version of the component: 2.0
  • Swift version: 3
  • iOS version: 10
  • Device: 6S
  • Xcode version: 8
  • If you use Cocoapods:

    Stack

   CocoaPods : 1.0.1
        Ruby : ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]
    RubyGems : 2.2.2
        Host : Mac OS X 10.12 (16A323)
       Xcode : 8.0 (8A218a)
         Git : git version 2.2.1
Ruby lib dir : /Users/dilizarov/.rbenv/versions/2.1.5/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ cee0a231b2467b60bf4de402ed67f0dfce068fbb
               twilio - https://github.com/twilio/cocoapod-specs @ f56585f3f6efb86db536a5123ae196729f05971d

Installation Source

Executable Path: /Users/dilizarov/.rbenv/versions/2.1.5/bin/pod

Plugins

cocoapods-deintegrate : 1.0.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.0.0

Podfile

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/twilio/cocoapod-specs'

target 'Chitchat' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  pod 'SwiftyJSON', '3.1.0'
  pod 'SCLAlertView-Objective-C', '1.0.3'
  pod 'SDWebImage', '3.8.2'
  pod 'TwilioIPMessagingClient'
  pod 'Alamofire', '4.0.1'
  pod 'SlackTextViewController', '1.9.4'
  pod 'ChameleonFramework/Swift'
  pod 'JGProgressHUD', '1.4'
  pod 'YALSideMenu', '2.0'

  # Honestly, I'd prefer to use just one library, but some bugs in ActiveLabel got me to include both of these. In the future, we can refactor some code to just incorporate one. Probably TTTAttributedLabel due to its verbosity
  pod 'ActiveLabel', :git => 'https://github.com/optonaut/ActiveLabel.swift.git', :branch => 'swift-3'
  pod 'TTTAttributedLabel', '2.0.0'
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '3.0'
        end
    end
end
  • If you use Carthage: run carthage version | pbcopy and insert here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.