MotionSwReveal
A ProMotion gem 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
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)
= UIButton. UIButtonTypeRoundedRect
add , {
font: FontAwesome.fontWithSize(20.0),
frame: CGRectMake(0, 0, 30, 30)
}
.setTitle FontAwesome.icon('bars'), forState: UIControlStateNormal
App.delegate.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request