Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added custom navigationBarClass support to NavigationController #1079

Conversation

phlippieb
Copy link
Contributor

@phlippieb phlippieb commented May 25, 2018

#1074

Adds an initializer to NavigationController that takes a custom navigation bar class parameter; this parameter is simply passed to super.

This extends NavigationController with the ability to be initialized with a user-defined subclass of NavigationBar.

@phlippieb
Copy link
Contributor Author

phlippieb commented May 25, 2018

Two other ways I can think of doing this are:

  1. Make the new init a designated initializer, and make the old init (that always passes NavigationBar.self to super) a convenience init.
  2. Give the navigationbarClass parameter a default value of NavigationBar.self

If you prefer either of those, I'll update my PR.

@OrkhanAlikhanov
Copy link
Contributor

Hey @phlippieb , thank you for your contribution. I would go with your first option. Which I guess what you meant should look like this, but with 2-spaced indention just like other parts of the file:

public override convenience init(rootViewController: UIViewController) {
  self.init(rootViewController: rootViewController, navigationBarClass: NavigationBar.self)
}
  
public init(rootViewController: UIViewController, navigationBarClass: AnyClass?) {
  super.init(navigationBarClass: navigationBarClass, toolbarClass: nil)
  setViewControllers([rootViewController], animated: false)
}

If @DanielDahan approves either option, You may remove the commit rebase development branch again and reapply changes and do one clean commit. To be honest, I am not sure about the second option.

Copy link
Member

@daniel-jonathan daniel-jonathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@daniel-jonathan daniel-jonathan merged commit 642bfef into CosmicMind:development Jun 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants