Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using asset images in Apple Watch Complications

I'm currently build a new Apple Watch App, that should support Complications. But I can't use an asset image in a Complication.

When I use a system image Image(systemName: "lock") everything is fine. But when I use an asset Image("image_name") it is not displayed.

I tried to copy the image to the WidgetExtension Assets, but this didn't help.

I'm using SwiftUI and WatchOS 9 for this...

Any ideas on this?

like image 837
Urkman Avatar asked Oct 23 '25 09:10

Urkman


1 Answers

Try using a UIImage instead.

Image(uiImage: UIImage(named: "lock") ?? "fallback")

Hope it works :)

like image 187
Ori Avatar answered Oct 25 '25 23:10

Ori



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!