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

Error in README example #28

Closed devth closed 10 years ago

devth commented 10 years ago

From README:

# Create a button with a custom bg & image
    swipe_btn = UIButton.custom
    swipe_btn.setBackgroundImage("nav_bar_menu_show_bg".uiimage, forState: :normal.uicontrolstate)
    swipe_btn.setImage("nav_bar_menu_show".uiimage, forState: :normal.uicontrolstate)
    size = "nav_bar_menu_show_bg".uiimage.size
    swipe_btn.frame = CGRectMake(0, 0, size.width, size.height)

UIButton.custom gives undefined method custom' for UIButton:Class (NoMethodError). Not sure what the correct alternative is?

macfanatic commented 10 years ago

I'll update the README, that method comes from another gem that I'm used to using :)

https://github.com/rubymotion/sugarcube#uibutton

devth commented 10 years ago

Thanks! sugarcube looks like something I should check out anyway.

macfanatic commented 10 years ago

I highly recommend it, adds so many convenience methods to RM on UIKit classes!