GantMan / RedAlert

iOS Alerts and ActionSheets with ease
MIT License
24 stars 15 forks source link

Always popover #17

Closed bmichotte closed 9 years ago

bmichotte commented 9 years ago

Relative to https://github.com/GantMan/RedAlert/pull/11

This PR force the use of popover when on iPad.

I changed the functionality with the following

If you want to present your alert in :sheet style and you are on iPad, you have to provide the :source for the popover (either a UIView or a UIBarButtonItem)

rmq.append(UIButton, :my_button).on(:tap) do |sender|
  rmq.app.alert(title: "Actions!", message: "Alert from a Popover.", 
                                   actions: [:ok, :cancel], style:sheet, source: sender)
end

You can also provide a :modal option if you want the popover to be modal. This option is only available for iOS 8+.

I have updated all tests to work on iPhone and iPad

bmichotte commented 9 years ago

I also corrected some tests which failed in localized iDevice

markrickert commented 9 years ago

Some of those corrected tests were included in my PR #13 that's already been merged. Looks like you need a rebase here before we can merge :)

bmichotte commented 9 years ago

I think it should be ok like this

markrickert commented 9 years ago

Loons good on my end. Maybe we should add an iPad spec build line to the travis file so we're getting full test coverage?

markrickert commented 9 years ago

Also... Wondering if we should also optionally support permittedArrowDirections for the pop over on iPad?

GantMan commented 9 years ago

This looks near done. I'm thinking we need mark's suggested travis ci spec change for this PR, and merge it. (Proper testing)

love the arrow_directions add!

bmichotte commented 9 years ago

Here are the arrow_direction option ;)

markrickert commented 9 years ago

Awesome! Thanks so much for this contribution!

GantMan commented 9 years ago

I think I'll merge this and solve the iPad tests issue in master real quick. :)

GantMan commented 9 years ago

Tests pass on iPad Air!

https://travis-ci.org/GantMan/RedAlert/builds/73426147

bmichotte commented 9 years ago

:+1: