UIActionSheet-Blocks icon indicating copy to clipboard operation
UIActionSheet-Blocks copied to clipboard

Unlimited buttons

Open nestorlafon opened this issue 10 years ago • 2 comments

I needed more than 10 buttons for a selection list and I saw the macro expanding the list of buttons was not the perfect solution.

I remove the macros and created a method with similar signature to the UIActionSheet init method but taking the array instead of the list of arguments. Using UIActionSheet methods I configure the list of buttons as it would look if added with the default init method.

I changed all code to use the new method when needed.

nestorlafon avatar Mar 10 '14 16:03 nestorlafon

Just trapped in the same situation. Any estimation when this will be merged and released to cocoapods?

emartynov avatar Sep 18 '14 12:09 emartynov

Hey guys - this looks like a great solution on the outside - but I need to do some more tests before merging it. I've had issues in the past where the indexes of buttons got messed up/inconsistent on iphone v. ipad when using the addButtonWithTitle: method on various versions of iOS. There are some issues internally to UIActionSheet and I didn't want to just add this and then have people's code taking incorrect paths in response to an alert action.

If you could take the time to write some tests to verify that the action and cancel button indexes are reported correctly, and test on iOS4.3+ (which this podspec supports) and iPad/iPhone that would be much appreciated and speed the merge of this PR.

If we find inconsistencies on older versions of iOS, I'm thinking about bumping the minimum target to 5 or 6+ and also make it ARC-only.

ryanmaxwell avatar Sep 21 '14 00:09 ryanmaxwell