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

Menu navigation screens don't call ProMotion view lifecycle methods #47

Closed markrickert closed 9 years ago

markrickert commented 9 years ago

A left or right menu that is a PM::Screen doesn't get sent the normal PM lifecycle methods like will_appear, did_appear, etc. However you can implement their objective-c counterparts and they'll be called.

class NavigationScreen < ProMotion::TableScreen
  def viewWillAppear(animated)
    # This will be called
  end

  def will_appear
    # This will not be called
  end

I have tests that fail for this scenario but i can't push them up at the moment because the public library I'm at blocks port 22 :cry:

jamonholmgren commented 9 years ago

This is strange. viewWillAppear(animated) should delegate through view_will_appear(animated) and subsequently will_appear.

markrickert commented 9 years ago

@jamonholmgren I just pushed up the failing tests so you can take a look.

jamonholmgren commented 9 years ago

OK thanks @markrickert !

jamonholmgren commented 9 years ago

@ryanlntn , would you want to take a look?

ryanlntn commented 9 years ago

On it @jamonholmgren !

ryanlntn commented 9 years ago

@markrickert @jamonholmgren defining view_will_appear(animated) in the screen causes specs to pass. I'm still not sure why that isn't in turn calling will_appear.

jamonholmgren commented 9 years ago

@ryanlntn Do you mean defining it like this? Perhaps the side screens aren't including PM::ScreenModule properly?

ryanlntn commented 9 years ago

@jamonholmgren Yep. The side screens are just PM::TableScreens. We're not doing anything different there.

ryanlntn commented 9 years ago

@markrickert I took a look at this again today and I think the issue may actually be with the tests and not the lifecycle methods. The simple app that I spun up to try to recreate this does call the lifecycle methods: Video

ryanlntn commented 9 years ago

@markrickert Closing this issue for now. Feel free to reopen if I'm missing something.