NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>

Home Screen widgets and blurred background.

Forums > SwiftUI

hello everyone, im playing with home screen widgets for the first time today :) I have a widget displaying on my home screen.

Rather than a solid color background i would like to make it translucent. ive been reading about Material but as far as I understand Material is used to blur out the background of "my" app when a view is dispayed and not the background of the home screen.

so any tips how i can blur the background for my home screen widget?

Thank you!

   

ChatGPT reply 😛

   

You cannot, and should not, blur the home screen when your widget is displayed for two reasons. First, it is up to the user on how they want to display the home screen background. Second, why should your app get preferential treatment and blur someone else's app widget? Or what if another app wanted to blur the home screen a different amount to yours?

What you can do is set the material in background of your app's widget. That is your area. And as you have already pointed out you can blur the screen's background once the user has selected your app to run.

   

You just solved all of my problem. Thanks for great website

   

Blurring the home screen while your widget is active isn't recommended or feasible for a couple of reasons. Firstly home screen background preferences are user-driven. Secondly, it's not fair for your app to blur someone else's widget or receive special treatment. Different apps may have unique blurring needs as well.

What's within your control is to utilize the material design for your app's widget background. That's your designated space. As you've mentioned, you can consider implementing background blurring once the user selects your app to run.

Best Regards smoothmove4u.com

   

Some really bad ChatGPT replies, one even parroting what I had said. I wonder if they will disappear, as one even mentions solutions for Android on an iOS forum.

   

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until October 1st.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.