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

Add preferredStyle to AlertOperation initializer #273

Merged
merged 4 commits into from Apr 12, 2016

Conversation

felix-dumit
Copy link
Contributor

I'd like to be able to use alert operation for showing an ActionSheet as well:

let alertOp = AlertOperation(presentAlertFrom: self, style: .ActionSheet)

@danthorpe
Copy link
Member

Looks good. Happy to merge. There isn't actually a test for the style, the only thing I would add would be an assert in to check that the preferred style is set.

@danthorpe danthorpe added this to the 2.10.0 milestone Apr 12, 2016
@danthorpe
Copy link
Member

Hi @felix-dumit - leave a comment when you're finished / ready to merge.

@felix-dumit
Copy link
Contributor Author

@danthorpe But it will always be set because of the default parameter?

I also want the addActionWithTitle method to return the UIAlertAction, so I can customize it or set the preferredAction property of the UIAlertController, (more practical that looping through the actions property of the UIAlertController and doing a comparison for the title.
That should be all.

@danthorpe
Copy link
Member

Thanks for the additions! 👍😄

@danthorpe
Copy link
Member

Yeah, it currently looks like it will always be set from the default parameter. But the test isn't just to ensure that now, it's to ensure that in the future this isn't changed or is broken.

@felix-dumit
Copy link
Contributor Author

@danthorpe Ok I added the tests, is that what you had in mind?

@danthorpe
Copy link
Member

Great - thanks for adding the test! Will merge shortly.

@danthorpe danthorpe merged commit 447a2e2 into ProcedureKit:development Apr 12, 2016
@felix-dumit felix-dumit deleted the patch-3 branch April 12, 2016 21:42
@danthorpe danthorpe modified the milestones: 3.0, 2.10.0 Apr 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants