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

Allow for multiple navigation bar items #441

Open
forrestgrant opened this issue Apr 1, 2014 · 3 comments
Open

Allow for multiple navigation bar items #441

forrestgrant opened this issue Apr 1, 2014 · 3 comments

Comments

@forrestgrant
Copy link
Contributor

To accomplish this, I've done the following:

first_button = UIBarButtonItem.alloc.initWithImage(first_image,
  style: UIBarButtonItemStylePlain,
  target: self,
  action: :first_action
)
second_button = UIBarButtonItem.alloc.initWithImage(second_image,
  style: UIBarButtonItemStylePlain,
  target: self,
  action: :second_action
)

self.navigationItem.rightBarButtonItems = [first_button, second_button]

It would be nice to implement something in PM such as:

set_nav_bar_buttons {
  right: [
    { image: first_image, action: :first_action },
    { image: second_image, action: :second_action }
  ],
  left: [
    { image: left_image, action: :left_action }
  ]
}
@jamonholmgren
Copy link
Owner

@markrickert, @silasjmatson, @ryanlntn, thoughts on the above API? Any alternatives?

PM 2.1+.

@markrickert
Copy link
Contributor

What if we made nav_bar_buttons an accessable array? We could do something like:

set_left_nav_bar_button whatever
left_nav_bar_buttons << some_other button

Just an idea, but may be half-baked.

@jamonholmgren
Copy link
Owner

I was tossing around that idea myself. Wouldn't be as consistent with our previous API, though.

@andrewhavens andrewhavens added this to the 3.0.0 milestone Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants