52inc / Pulley

A library to imitate the iOS 10 Maps UI.
https://cocoapods.org/pods/Pulley
MIT License
2.02k stars 265 forks source link

UIVisualEffectView in drawer not working #5

Closed Anviking closed 8 years ago

Anviking commented 8 years ago

Hi!

Neither in the demo, nor in my own app I can get the blurry drawer background to work. It's just transparent. Any ideas? I'm using the latest beta.

Also thanks for making this!

img_0342

amyleecodes commented 8 years ago

You have the simulator set to use low-quality visual effects.

Anviking commented 8 years ago

It's an real device though, and the status bar blur view is working…

amyleecodes commented 8 years ago

Looks like it's a known iOS 10 issue for visual effect views that have been masked: https://forums.developer.apple.com/thread/50854

Masking via CALayer works in iOS 9 (which is what this was written targeting), but iOS 10 you have to use the maskView property of the UIView.

amyleecodes commented 8 years ago

I'm working on a fix, one minute.

amyleecodes commented 8 years ago

Ok, after trying a handful of things and reading through the issues being encountered in that thread (even in the latest beta) it looks like the solution to this is a much lengthier one.

Right now the PulleyDrawerController rounds the drawer view and creates the shadow automatically. However, in order to do this, it's required to mask the drawer VC as a whole. This seems to be incompatible with iOS 10's implementation of UIVisualEffectView (possibly fixed in release?). Instead, the puller drawer wouldn't be able to provide rounding or shadow services at all and would need to leave that up to the drawer content controller itself. This dramatically complicates the implementation for people using the drawer.

My approach right now is going to be:

• See if the final iOS 10 beta / SDK have this issue fixed so that it behaves like iOS 8 / 9, in which case that will no longer be a problem.

• If not, look for a way for the pulley drawer to handle blurred background views internally so that the end user of the library doesn't need to worry about masking / shadows. This is a longer solution that will break some implementations, so unless tomorrow's final SDK doesn't fix it....I don't want to make this drastic of a change. If I need to, I will.

Apologies that I don't have a better answer. However, tomorrow I'll know more and can provide better guidance. If I have to create a new implementation, it'll probably take the form of a "useBlurredBackground" boolean on the drawer so the fallout for existing usages should be minimal.

amyleecodes commented 8 years ago

Problem resolved in an update to Pulley.

weyert commented 8 years ago

@brendan09 I really like this library. Would you have any suggestions how to make this work with iOS 9? It's appears to be working partly already before the above changes. I am wondering if it's possible to make it work for iOS 9 too while using your new approach UIVisualEffectView. What do you think?

amyleecodes commented 8 years ago

The original version was iOS 8+ compatible. I assume this one is as well, however I'll admit to not having extensively tested this version on iOS 9. What does it do on iOS 9?

amyleecodes commented 8 years ago

Ok, I just rechecked the current version on iOS 8.4, 9.3, and 10.0 and it seems to work correctly on all OS versions like I thought.

What problem are you having using it on iOS 9?

weyert commented 8 years ago

Oh, I just having the feeling the visual effect view didn't work. Let have a look at it again tomorrow. Thank you. Great library.

amyleecodes commented 8 years ago

Should work fine. If not, let me know.