autresphere / ASDepthModal

An Objective-C class that adds a sense of depth to your modal popup views.
MIT License
430 stars 74 forks source link

suggestion fot tap outside to close #7

Closed jonasman closed 11 years ago

jonasman commented 11 years ago

This feature Tap outside to close could be optional via use of a property.

What do you think?

autresphere commented 11 years ago

Why not!

In order to avoid several additional parameters in the API for each new option, a good idea would be to use a single options parameter like the one in [UIView animateWithDuration:options] which bears several different kind of values. Then we could move the blur and style into this parameter. The API would become

[ASDepthModalViewController presentView:withBackgroundColor:options:].

And options would be something like

typedef NS_OPTIONS(NSUInteger, ASDepthModalOptions) {
    ASDepthModalOptionAnimationGrow
    ASDepthModalOptionAnimationShrink,
    ASDepthModalOptionAnimationNone,
    ASDepthModalOptionBlur,
    ASDepthModalOptionBlurNone,
    ASDepthModalOptionTapOutsideToClose,
    ASDepthModalOptionTapOutsideInactive
}

Would it be easier for you like that? What's your opinion?

jonasman commented 11 years ago

It is a good option the options, in case the options are nil it would use the default ones.

autresphere commented 11 years ago

So, I'll try to change the API as soon as I have time. Or maybe you want to contribute on this?

jonasman commented 11 years ago

I never did any contrib in github, I will try if i have some time :)

jonasman commented 11 years ago

https://github.com/autresphere/ASDepthModal/pull/9