No commit activity in last 3 years
No release in over 3 years
Provides a subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

MotionSwReveal

A ProMotion wrapper for SWRevealViewController by John Lluch, heavily inspired on Promotion Slide Menu by Matt Brewer that depends on PKRevealController by Phillip Kluz. I could not get Promotion Slide Menu working on RubyMotion and ProMotion 1.1+. I have used SWRevealViewController before and I like it's ease of usage. This gem should be easy to use as well.

Installation

Add this line to your application's Gemfile:

gem 'motion_sw_reveal'

And then execute:

$ bundle

Or install it yourself as:

$ gem install motion_sw_reveal

Usage

Basic use:

# App Delegate

def on_load
  # Open a RevealScreen with:
  #  - NavigationScreen in the background.
  #  - HomeScreen as front screen.
  #
  open_reveal_screen NavigationScreen.new, HomeScreen.new(nav_bar: true)
end

This opens a new HomeScreen. Swiping it to the right will reveal the NavigationScreen.

If you want a button to show the NavigationScreen, just bind an action for it:

# Create a button (I use FontAwesome for the bars icon)
  def add_menu_button
    menu_btn = UIButton.buttonWithType UIButtonTypeRoundedRect
    menu_btn.setTitle FontAwesome.icon('bars'), forState: UIControlStateNormal
    menu_btn.setTitleColor hex_color('999999'), forState: UIControlStateNormal
    
    set_attributes menu_btn, {
      font:  FontAwesome.fontWithSize(20.0),
      frame: CGRectMake(0, 0, 30, 30)
    }

    @left_nav = UIBarButtonItem.alloc.initWithCustomView(menu_btn)
    self.navigationItem.leftBarButtonItem = @left_nav

    App.delegate.bind_reveal_screen_button menu_btn
  end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request