STPopup icon indicating copy to clipboard operation
STPopup copied to clipboard

Add all relevant UINavigationController functionality

Open AnthonyMDev opened this issue 8 years ago • 4 comments

STPopupController is supposed to work just like a UINavigationController. Currently, it only supports pushViewController: animated: completion: and popViewControllerAnimated:.

I'd like to propose the following UINavigationController functionality be implemented:

  • topViewController (Implemented in PR #43)
  • popViewControllerAnimated should return the popped controller
  • popToViewController: animated
  • popToRootViewControllerAnimated
  • viewControllers
    • Make property public
    • Make property editable - (Rejected)
    • setViewControllers: animated: - (Rejected)
  • UIToolbar functionality
    • Toolbar should respect UIViewController's toolbarItems
    • toolbarHidden property
    • setToolbarHidden: animated:
  • delegate that has methods mirroring `UINavigationControllerDelegate

I'd be happy to assist in implementing some of these features, but I wanted to open up discussion on them first.

AnthonyMDev avatar Jan 15 '16 04:01 AnthonyMDev

@AnthonyMDev Thanks for the suggestions. The reason I haven't supported all the navigation controller functions is I want to keep it simple and most of the time we don't need them. And I think we will only push 2-3 view controllers into popupController? Having a complex view controllers stack in a popup may not be a good UX. But it is still nice to have popToViewController:animated and popToRootViewControllerAnimated. The UIToolbar functionality would be very usable though.

kevin-lyn avatar Jan 15 '16 05:01 kevin-lyn

@kevin0571 That's fair. I've updated the proposal.

I still think the ability to access the viewControllers property would be very valuable and easy to implement, as it's already there, just private. Making it editable may be too complex.

The rest of these you would be open to implementation on though? I'd be interested in helping to implement some of this.

AnthonyMDev avatar Jan 19 '16 21:01 AnthonyMDev

@AnthonyMDev Sure. Thanks for help. Any confusion regarding the internal implementation, we can discuss here.

kevin-lyn avatar Jan 20 '16 05:01 kevin-lyn

+1 for making viewControllers public, that would be incredibly helpful!

jakubheglas avatar Mar 28 '17 15:03 jakubheglas