Gradient Blur Image in SwiftUI!
Вставка
- Опубліковано 6 вер 2024
- Today we look into how Apple manages to make a gradient blur as they do in the App Store & TV App.... they probably have their own proprietary thing, but are just too selfish to let us have the power. So, let's hack something together shall we!
Jarvis Desk - goo.gl/JbVrWF
Fully Lumen Lamp - goo.gl/ndZUKD
Topo Anti-Fatigue Mat - goo.gl/sZ2n52
~Social Stuff~
Website - www.archet.app
Twitter/Instagram - @archetapp
Nice little video! Perhaps this could be built int iOS 15 with the new materials? I'm gonna try it out and let you know :D
I would hope so!
Hey, thanks for the nice tutorial! That was my first approach and it works brilliant.
But then I reworked it differently. You could just add a view with blur, as subview. Then add an alpha mask on the view. Thus you won't need 2 ImageViews:
let imageView = UIImageView(image: UIImage(named: "image"))
view.addSubview(blurView)
let blurContainerView = UIView()
let blurView = UIVisualEffectView(effect: UIBlurEffect(style: .dark))
blurContainerView.addSubview(blurView)
// Add alpha-mask on blurContainerView => this will make the blur transition smooth
view.addSubview(blurView)
thanks for the guide
Great workaround for most people, but it’s worth noting that this isn’t how it’s done. It’s a progressive blur that increases radius from start to finish, and is most likely a custom implementation of the gaussian blur algorithm by Apple. It’s also used for the status bar in notification view
Great tutorial. Built my first app because of you. Hope you’re well!
That’s awesome man! What’s the app?
And I’m doing just great. :]
Hey Jared. I’ve got a quick question for you, I get how to make a tabbar page view and switch between different tabs. But how do I make it dynamic like on Instagram where you can click on posts and posts you’re tagged in. But if one page is bigger than the other it doesn’t effect the other page. You’re the expert so I thought I’d ask you :)
Great video! Just one remark, you should be able to replace Color.white.opacity(0) by Color.clear 😉
No, he should NOT
Color.clear is BLACK color with zero alpha channel, and in case gradient is mixing colors together, it will mix main color with black one
Thanks Jared!
Seus vídeos estão incríveis
Dope effect!
Yep!
E ai Jared e o canal em Portugues :)
Grande abraço
You're confused. Suddenly You upload videos after long time. Now You will disappear for long time then suddenly come back here. What's that?
New job. 3 side projects… I just do UA-cam when I can. 😅