在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:aryaxt/iOS-Slide-Menu开源软件地址:https://github.com/aryaxt/iOS-Slide-Menu开源编程语言:Objective-C 99.2%开源软件介绍:iOS-Slide-MenuNOTE: If your application supports both landscape and portrait and supports iOS versions below 8, use version 1.4.5 iOS Slide Menu built on top of UINavigationController, with configurable buttons, reveal animations, and tap/swiper gesture recognizers.
Version 1.4.5 NotesEnabling shouldRecognizeSimultaneouslyWithGestureRecognizer was causing issues, if you are seeing unexpected gesture behavior delete the pod and reinstall as that method has been removed Version 1.4.0 Notes
New features:
Version 1.3.0 NotesIf you are updating from previous versions you'll get compile errors, due to changes to RevealAnimations. Animation configuration is now handled differently, and is separated from the SlideNavigationController. Please see bwlow for more information. Setup
Configuring Left and Right menu for different ViewcontrollersYou decide whether to enable or disable slide functionality on each viewController by implementing the following delegate methods of SlideNavigationControllerDelegate. These methods are optional, and if not implemented the menu functionality will be disabled for that particulat viewController.
Public propertiesavoidSwitchingToSameClassViewControllerDefault value is set to YES. If set to YES when switching to a new ViewController if the new viewcontroller is the same type as the current viewcontroller it'll close the menu instead of switching to the viewController. If set to NO it'll switch to the viewController regardless of types This can be usefull when you have a menu item, and when the user selects an already selected menu item you don't want to navigate to a new instance of the viewController enableSwipeGestureWhen set to YES user can swipe to open the menu When set to NO swipe is disabled, and use can only open the menu using the UIBarButtonItem added to the navigationBar ######panGestureSideOffset This property allows you to limit the gesture to the sides of the view. For instance setting this value to 50 means touches are limited to 50 pixels to the right and 50 pixels to the left of the view. This could be useful if you are expecting slide-to-delete functionality on UITableViews. Default value of panGestureSideOffset is set to 0. Setting panGestureSideOffset to 0 means touches are detected in the whole view if enableSwipeGesture is set to true. enableShadowA boolean that allows you to turn shadow on/off. On default shadow is set to true rightMenuThe viewController of the right menu in the navigationController leftMenuThe viewController of the left menu in the navigationController leftBarButtonItemDefault value is null. When this button is set navigationController uses this UIBarButtonItem as the leftItem. this property is intended to be used when a custom UIBarButton is needed (UIBarButtonItem initialized with a custom view) rightBarButtonItemBehaves exactly the same as leftbarButtonItem, but it's used as the right button for the menu portraitSlideOffsetDefault value of portraitSlideOffset is 60. This means when the menu is open, the width of the visible portion of the navigation controller is 60 pixels in portrait mode landscapeSlideOffsetDefault value of portraitSlideOffset is 60. This means when the menu is open, the width of the visible portion of the navigation controller is 60 pixels in landscape mode menuRevealAnimationDurationDefault value of animation duration is .3, this property allows configuring animation duration menuRevealAnimationOptionDefaults to UIViewAnimationOptionCurveEaseOut, you can change this property to configure animation options menuRevealAnimatormenuRevealAnimator is used to animate the left/right menu during reveal. The default value is nil, that means no animations occure when opening/closing the menu. There are existing animation classes that can be used. These animation classes can be configured through init method options.
Public Methods+ (SlideNavigationController *)sharedInstance;Returns the singleton instance of SlideNavigationController - (void)switchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion;This method is deprecated - (void)popToRootAndSwitchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion;Pops to root view controller and calls the completion. - (void)popToRootAndSwitchToViewController:(UIViewController *)viewController withSlideOutAnimation:(BOOL)slideOutAnimation andCompletion:(void (^)())completion;Similar to previous method, but allows turning on/off slide-out-animation during the switch - (void)popAllAndSwitchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion;Replaces the ViewController stack with a new stack that includes the new ViewController, and calls completion - (void)popAllAndSwitchToViewController:(UIViewController *)viewController withSlideOutAnimation:(BOOL)slideOutAnimation andCompletion:(void (^)())completion;Similar to previous method, but allows turning on/off slide-out-animation during the switch - (void)openMenu:(Menu)menu withCompletion:(void (^)())completion;Opens a given menu and calls the completion block oppon animation completion - (void)closeMenuWithCompletion:(void (^)())completion;Closes the menu and calls the completion block oppon animation completion - (void)toggleLeftMenu;Toggles the left menu open or close depending on the existing state. This was made public in order to pass the selector to a custom UIBarButtonItem (ex: UIBarButtonItem with a button as a custom view)
- (void)bounceMenu:(Menu)menu withCompletion:(void (^)())completion;Bounces either right or left menu, and calls the completion block oppon animation completion - (void)toggleRightMenu;Works exactly the same as toggleLeftMenu, but used to toggle left menu - (BOOL)isMenuOpen;Returns a boolean stating whether the menu is open or not Custom AnimationsSlideNavigationController allows custom reveal animations. In order to add custom animations create a new class implementing SlideNavigationContorllerAnimator protocol. For more information take a look at the existing animation classes. - (void)prepareMenuForAnimation:(Menu)menu;This method gets called right before the menu is about to reveal - (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress;This method gets called as the menu reveal occurs, and passes the progress to be used for animations(progress is between 0 and 1) - (void)clear;This method gets called if for any resons the instance of animator is being changed. For instance, the animator is changed from SlideNavigationContorllerAnimatorFade to SlideNavigationContorllerAnimatorSlide. In this method you should cleanup the state of the menu if neede. For instance if you added a view to the menu for reveal animation, you should remove it when clear gets called. Public Methods NotificationsSlideNavigationControllerDidOpenThis notification is posted EVERY time the menu goes inot a complete open state Userinfo contains a value with key "menu", which could have 2 values "left" and "right" SlideNavigationControllerDidCloseThis notification is posted EVERY time the menu goes inot a complete close state Userinfo contains a value with key "menu", which could have 2 values "left" and "right" SlideNavigationControllerDidRevealThis notification is posted once everytim a menu reveals Userinfo contains a value with key "menu", which could have 2 values "left" and "right" |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论