← Back to romaonthego/RESideMenu

How to Deploy & Use romaonthego/RESideMenu

RESideMenu Deployment & Usage Guide

A comprehensive guide for integrating the RESideMenu iOS side menu library into your project.

1. Prerequisites

Before you begin, ensure you have the following installed:

  • macOS with latest updates
  • Xcode 6.0 or higher (from Mac App Store or Apple Developer)
  • iOS SDK matching your target deployment version (iOS 6.0+)
  • Git (for cloning repository or CocoaPods)
  • CocoaPods (recommended, version >= 0.28.0) - optional but recommended
  • Command Line Tools for Xcode (xcode-select --install)

Verify installations:

xcodebuild -version
git --version
pod --version  # if using CocoaPods

2. Installation

Choose one of the following installation methods.

Method A: CocoaPods (Recommended)

  1. Navigate to your Xcode project directory:

    cd /path/to/YourProject
    
  2. Create or edit your Podfile:

    touch Podfile
    open -e Podfile  # or use any text editor
    
  3. Add the RESideMenu pod specification:

    platform :ios, '6.0'
    pod 'RESideMenu', '~> 4.0.7'
    
  4. Install the pod:

    pod install
    
  5. Important: From this point forward, open your project using the .xcworkspace file:

    open YourProject.xcworkspace
    

Method B: Manual Installation

  1. Clone or download the repository:

    git clone https://github.com/romaonthego/RESideMenu.git
    
  2. Drag the RESideMenu folder from the cloned repository into your Xcode project's file navigator.

  3. Ensure the following files are added to your target's "Compile Sources" build phase:

    • RESideMenu.h
    • RESideMenu.m
    • All other .m files in the RESideMenu folder
  4. In any class that uses RESideMenu, add the import:

    #import "RESideMenu.h"
    

3. Configuration

RESideMenu requires configuration in your app's root view controller setup.

Programmatic Setup (AppDelegate)

In your AppDelegate.m application:didFinishLaunchingWithOptions: method:

// 1. Create your content view controller (typically embedded in a navigation controller)
UIViewController *contentVC = [[YourContentViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:contentVC];

// 2. Create left and/or right menu view controllers
UIViewController *leftMenuVC = [[YourLeftMenuViewController alloc] init];
UIViewController *rightMenuVC = [[YourRightMenuViewController alloc] init]; // Optional

// 3. Initialize RESideMenu
RESideMenu *sideMenuVC = [[RESideMenu alloc] initWithContentViewController:navigationController
                                                     leftMenuViewController:leftMenuVC
                                                    rightMenuViewController:rightMenuVC];

// 4. Optional customization
sideMenuVC.backgroundImage = [UIImage imageNamed:@"your_background"]; // Parallax background
sideMenuVC.animationDuration = 0.3; // Default is 0.3

// 5. Set as root view controller
self.window.rootViewController = sideMenuVC;
[self.window makeKeyAndVisible];

Storyboard Integration

  1. Create a subclass of RESideMenu (e.g., DEMORootViewController).
  2. In your Main.storyboard:
    • Set the initial view controller's class to your subclass.
    • Set the view controller's Storyboard ID to contentViewController.
    • Add two additional view controllers and set their Storyboard IDs to leftMenuViewController and rightMenuViewController.
  3. In your subclass implementation (DEMORootViewController.m):
    - (void)awakeFromNib
    {
        self.contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"contentViewController"];
        self.leftMenuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"leftMenuViewController"];
        self.rightMenuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"rightMenuViewController"];
    }
    

4. Build & Run

Running the Demo Projects

  1. Open either example project:

    • RESideMenuExample/RESideMenuExample.xcodeproj (programmatic setup)
    • RESideMenuStoryboardsExample/RESideMenuStoryboardsExample.xcodeproj (storyboard setup)
  2. Select a simulator (iOS 6.0+).

  3. Press Cmd+R to build and run.

Running Your Integrated Project

  1. Open your .xcworkspace (if using CocoaPods) or .xcodeproj.
  2. Select your target device/simulator.
  3. Press Cmd+R.

Key interactions in the running app:

  • Swipe from the left edge to open the left menu (if panFromEdge = YES, default).
  • Swipe from the right edge to open the right menu.
  • Tap the menu button (if added) to toggle menus programmatically.
  • Tap outside the menu or swipe content view to close.

5. Deployment

RESideMenu is a library, not a standalone application. "Deployment" means integrating it into your app and distributing your app.

For Development & Testing

  • Test on multiple iOS versions (6.0+).
  • Test on both iPhone and iPad if your app is universal.
  • Test rotation if your app supports it.

For App Store Distribution

  1. Ensure your project's Deployment Target is set to iOS 6.0 or higher.
  2. Verify all required icons and launch images are set.
  3. Archive your app (Product > Archive).
  4. Validate and upload via Xcode Organizer or Transporter.

Note: RESideMenu uses ARC. If your project does not use ARC, you must add the -fobjc-arc compiler flag to the RESideMenu source files in Build Phases > Compile Sources.

6. Troubleshooting

Common Issues & Solutions

CocoaPods installation fails

  • Ensure Git >= 1.8.0: git --version
  • Update CocoaPods: sudo gem install cocoapods
  • Run pod repo update then pod install
  • Check network/firewall settings

"RESideMenu.h file not found"

  • If using CocoaPods: Ensure you opened the .xcworkspace, not .xcodeproj.
  • If manual: Verify the RESideMenu files are in your project and added to the target.

Menu doesn't appear / gestures not working

  • Check panGestureEnabled is YES (default).
  • Verify panFromEdge is YES if expecting edge swipe.
  • Ensure panMinimumOpenThreshold (default 0) isn't set too high.
  • Confirm your content view controller's view isn't intercepting touches (e.g., a full-screen transparent view).

Parallax effect not working

  • Set backgroundImage property on the RESideMenu instance.
  • Ensure scaleBackgroundImageView is YES (default for parallax effect).

ARC errors in non-ARC project

  • In Build Phases > Compile Sources, select all RESideMenu .m files.
  • Add -fobjc-arc to the Compiler Flags column for each file.

Storyboard IDs not recognized

  • Double-check that the Storyboard IDs in Interface Builder exactly match the strings used in instantiateViewControllerWithIdentifier: (case-sensitive).
  • Ensure the view controllers are in the same storyboard file as the RESideMenu subclass.

Content view doesn't scale with menu

  • Verify scaleContentView is YES (default is YES).
  • Check contentViewScaleValue (default 0.8). Adjust between 0.0 and 1.0.

Shadow not appearing on content view

  • Ensure contentViewShadowEnabled is YES.
  • Set contentViewShadowColor, contentViewShadowOffset, contentViewShadowOpacity, and contentViewShadowRadius to visible values.

Menu view controllers not retaining

  • Ensure you are not releasing menu view controllers prematurely if managing memory manually (ARC handles this).

For further issues, check the GitHub Issues page.