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

Support of older devices #1

Open
EliaCereda opened this issue Aug 13, 2013 · 5 comments
Open

Support of older devices #1

EliaCereda opened this issue Aug 13, 2013 · 5 comments

Comments

@EliaCereda
Copy link

Unsurprisingly this works only on devices where blurs are enabled system-wide (basically everything but iPhone 4 I think). It may not be a big issue, but iPhone 4's user base is still important enough that this issue should at least be noted. ;)

PS: you're the ONLY result about UIBackdropView, in case you were wondering how I found this project that has no stars and forks... LOL

@dimitribouniol
Copy link
Member

As long as it doesn't crash completely, then we are good :) — I designed it so it would behave like other blur views on the system, and fall back to no blur but similar look on older systems.

If you want an unsupported way of getting it working on any iOS 7 device, you could use the UIBackdropView directly, or even the CAFilter (That UIBackdropView uses internally) if you want it working all the way back to iOS 4 :P

@EliaCereda
Copy link
Author

I spent some hours today digging into the implementation of UIBackdropView, it's definitely an amazing usage of CoreAnimation...

It makes me sad, though, that the limitation of graphics quality on older devices is completely arbitrary and, while I can't say what cost would have on the performances of the devices (I'd need a jailbreak to enable it system-wide), I'm definitely able to proof that the iPhone 4 is perfectly capable of those enhanced effects.

That said, here's something that you should definitely hear: I asked Jake Behrens (Apple UI evangelist ;) ) if it's ok to use your little library in App Store apps and this was his response.

This is a hack and is not supported at all. You’re dipping into a view hierarchy and layer tree that you did not create, using undocumented pieces, and are expecting specific results. This is not an advisable “solution."

Jake

It doesn't sound like an explicit no, so probably you won't be rejected, but it's not an yes either.
I then asked if there is a legit alternative to be used on dynamic views (I mean, views where you can't use the code from UIImageEffects) but the response was again negative (which is what I suspected anyway).

No, there is no public API for blurring dynamic or “live" content. This was done due to performance reasons and side effects.

Jake

Hope this information may be useful to you. ;)

@dimitribouniol
Copy link
Member

It's nice to hear something official. It is unfortunate that no other options are available, but I'm willing to bet mis-using UINavigationBars is a lot more effective and performant than manually compositing the view hierarchy and blurring it 60 times a second :P

@EliaCereda
Copy link
Author

It's not even feasible: according to Apple own benchmarks -drawViewHierarchyInRect:afterScreenUpdates: takes 145ms (in a pretty complicated situation), which is longer than the length of a refresh cycle by an order of magnitude.
I guess we must stick with borderline hacks. 😄

@dimitribouniol
Copy link
Member

Well, if you take out all the masking requirements (the bulk of the hack), then it's not all that hacky :D

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

No branches or pull requests

2 participants