yalantis / side-menu.ios Goto Github PK
View Code? Open in Web Editor NEWAnimated side menu with customizable UI
Home Page: https://yalantis.com/?utm_source=github
License: MIT License
Animated side menu with customizable UI
Home Page: https://yalantis.com/?utm_source=github
License: MIT License
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
The more information you provide, the faster we can help you.
Please describe what you want to add to the component.
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert here cocoa podscarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
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.
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
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 ?
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.
The more information you provide, the faster we can help you.
Please describe what you want to add to the component.
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
please add carthage support
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.
# 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 :
To confirm, I used menu button in another viewController(which was not embedded in UINavigationController), and it worked fine.
### Your Environment
I ran the latest pods in my project
The more information you provide, the faster we can help you.
Please describe what you want to add to the component.
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
I want to use Sourcegraph for Side-Menu.iOS code search, browsing, and usage examples. Can an admin enable Sourcegraph for this repository? Just go to https://sourcegraph.com/github.com/Yalantis/Side-Menu.iOS. (It should only take 30 seconds.)
Thank you!
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
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:
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.
The more information you provide, the faster we can help you.
Please describe what you want to add to the component.
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
The more information you provide, the faster we can help you.
Please describe what you want to add to the component.
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
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.
The more information you provide, the faster we can help you.
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.
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.
It crashed & has this error: Redundant conformance of 'ViewController' to protocol 'UIViewControllerTransitioningDelegate'
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert heren/a
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
my application support arabic langauge , so i need to show the menu from right direction
not from left direction . is this possible ??
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!!
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.
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
Executable Path: /Users/dilizarov/.rbenv/versions/2.1.5/bin/pod
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
# 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
carthage version | pbcopy
and insert herecarthage update
cannot generate any framework. It just cloned this repo but nothing happened.
Can you please let me know how to implement this animation in Objective C.
Swift Compile Error
No such module 'SideMenu'
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
The more information you provide, the faster we can help you.
Please describe what you want to add to the component.
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
How to hide this menu button from some viewcontrollers?
According to new Swift standards, we should use 'as!' instead of 'as' for casting. You can just replace 'as' with 'as!' for all occurrences.
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
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.
The more information you provide, the faster we can help you.
Please describe what you want to add to the component.
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
I can't show AlertViewController on navigator object.
I tried all different options to get the viewcontroller from uinavigationcontroller and navigator object but its not working.
It should show the alert on the screen.
Nothing happened.
The more information you provide, the faster we can help you.
side menu animation exactly what your showing in your image
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
No more updates in this project?
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.
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
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.
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
The more information you provide, the faster we can help you.
Please describe what you want to add to the component.
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
The more information you provide, the faster we can help you.
Please describe what you want to add to the component.
Please add images.
Please replace this with what you did.
Please replace this with what you expected to happen.
Please replace this with what happened instead.
pod env | pbcopy
and insert herecarthage version | pbcopy
and insert herePlease add a link to a project we can download that reproduces the bug.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.