MCPanelViewController

MCPanelViewController is a drop-in panel control for iOS that provides blurring backgrounds and screen-edge activation gestures. It allows developers to easily implement sliding panels in their iOS applications with customizable

322
25

MCPanelViewController

A drop-in panel control for iOS featuring a blurring background and screen-edge activation gestures.

Installation

Integrate via CocoaPods using pod 'MCPanelViewController', as a git submodule, or by copying the files from the MCPanelViewController folder.

Using MCPanelViewController

Instantiate MCPanelViewController with a root view controller. Set the panel width using the preferredContentSize property of your view controller. Present the panel programmatically using presentInViewController:withDirection: or the convenience method presentPanelViewController:withDirection:, specifying either MCPanelAnimationDirectionRight or MCPanelAnimationDirectionLeft. Dismiss the panel using dismiss.

Optional Configuration

Customize the panel by disabling the background masking effect (masking = NO), disabling pan gestures (panningEnabled = NO), or adjusting the background style (backgroundStyle). Available background styles include MCPanelBackgroundStyleTinted (with customizable tintColor), MCPanelBackgroundStyleLight, MCPanelBackgroundStyleExtraLight, and MCPanelBackgroundStyleDark.

Screen Edge Gestures

Enable screen-edge gestures using the convenience methods addGestureRecognizerToViewForScreenEdgeGestureWithPanelViewController:withDirection: in viewWillAppear: and removeGestureRecognizersFromViewForScreenEdgeGestureWithPanelViewController: in viewDidDisappear:.

License

MCPanelViewController is available under the MIT license.

Repository

MA
matthewcheok

matthewcheok/MCPanelViewController

Created

October 3, 2013

Updated

January 17, 2025

Language

Objective-C

Category

Developer Tools