handsomecode / InteractiveSideMenu

iOS Interactive Side Menu written in Swift.
Apache License 2.0
708 stars 164 forks source link

Rework MenuViewController from subclass to protocol #31

Closed truemetal closed 7 years ago

truemetal commented 7 years ago

This commit changes MenuViewController from being a subclass of UIViewController to a protocol. The motivation: Allow NavigationMenuViewController be a subclass of another class, e.g.:

class BaseViewController: UIViewController {
   // some logic 
}

class NavigationMenuViewController: BaseViewController {
   // you can use BaseViewController's logic here
}

This also allows use of UINavigationController as menu (e.g. if you want that navigation bar)

truemetal commented 7 years ago

Though now when I think about this, it's probably better to remove protocol whatsoever, and just have an extension on UIViewController

okonor commented 7 years ago

Thank you for your updates. I'll review it this week.

AndreyArzhannikov commented 7 years ago

@truemetal Thanks for your PR! Unfortunately, we don't feel able to merge your changes at this time but it’s a good idea to allow NavigationMenuViewController be a subclass of another class. We added this to our enhancements backlog.