Chapter 27
Applying a Blurred Background Using UIVisualEffect
It's been seven years now. I still remembered how Jonathan Ive described the user interface redesign of iOS 7. Other than "Flat" design, the mobile operating system introduced new types of depth in the words of the Apple's renowned design guru.
One of the ways to achieve depth is to use layering and translucency in the view hierarchy. The use of blurred backgrounds could be found throughout the mobile operating system. For instance, when you swipe up the Control Center, its background is blurred. Moreover, the blurring effect is dynamic and keeps changing with respect to the background image. At that time, Apple did not provide APIs for developers to create such stunning visual effects. To replicate the effects, developers were required to create their own solutions or make use of the third-party libraries.
From iOS 8 and onwards, Apple opened the APIs and provided a new method which makes it very easy to create translucent and blurring-style effects. It introduced a new visual effect API that lets developers apply visual effects to a view. You can now easily add blurring effect to an existing image.
In this chapter, I will go through the API with you. Again, we will build a simple app to see how to apply the blurring effect.
To continue reading and access the full version of the book, please get the full copy here. You will also be able to access the full source code of the project.