infinitered / ProMotion-menu

RubyMotion gem allowing you to easily setup a facebook or Path style hidden slide menu easily with the ProMotion gem.
74 stars 29 forks source link

Sample in the Readme does not work. #52

Closed GCorbel closed 9 years ago

GCorbel commented 9 years ago

Hi,

I did an new project only with the code shown in the Readme. I have this :

# app_delegate.rb
class AppDelegate < PM::Delegate
  def on_load(app, options)
    @menu = open MenuDrawer
  end

  def show_menu
    @menu.show :left
  end
end

#menu_drawer.rb
class MenuDrawer < PM::Menu::Drawer

  def setup
    self.center = HomeScreen.new(nav_bar: true)
    self.left = NavigationScreen
    self.to_show = [:pan_bezel, :pan_nav_bar]
    self.transition_animation = :swinging_door
    self.max_left_width = 250
    self.shadow = false
  end

end

#navigation_screen.rb
class NavigationScreen < ProMotion::TableScreen

  def table_data
    [{
      title: nil,
      cells: [{
        title: 'OVERWRITE THIS METHOD',
        action: :swap_center_controller,
        arguments: HomeScreen
      }]
    }]
  end

  def swap_center_controller(screen_class)
    app_delegate.menu.center_controller = screen_class
  end

end

My app is running but there is no sidebar as you can see here :

ios simulator screen shot 2015-03-12 17 36 39

Did I miss something ?

Thanks for your great work !

GCorbel commented 9 years ago

I added the issue on StackOverflow.

ryanlntn commented 9 years ago

@GCorbel I answered on StackOverflow but I'll summarize here. What you have is correct. The left controller is hidden when you first open the app. You need to pan to reveal it. Here's an example complete with menu button: https://github.com/ryanlntn/pm-menu-issue-52

I'm closing this for now but feel free to reopen if you're still having issues.

GCorbel commented 9 years ago

It works. I really like your project. You did a really good job!

ryanlntn commented 9 years ago

:blush: Thanks @GCorbel. It's not just my project though. Most of the credit goes to Jamon Holmgren, Matt Brewer, and several other contributors. Please let us know if you run into any more issues and feel free to submit a PR with improvements. We love it when ProMotion users become ProMotion contributors. :smile:

GCorbel commented 9 years ago

Thanks @ryanlntn , @jamonholmgren and @macfanatic . I will see for contributaion later maybe. I have to see if I do more mobile apps and if I continue to use RubyMotion.