Environment: Xcode16, iOS 18.1 official version
Background: I created a control center widget using a custom sf symbol
Phenomenon: When I first installed it, it displayed normally in the control gallery, but when I recompiled and installed it again, the icon disappeared when I looked at it again in the control gallery. I used Console to check the error log and found that its output was' No image named 'my_custom _symbol_name' found in asset catalog for/private/var/containers/Bundle/Application/F977FCFB-DA1C-4924-8613-50531CA2A364/MyDemoApp. app/PlugIns/MyDemoApp Extension. apex '. I found that this uuid was not consistent with the uuid I print during debugging, as if the control gallery had done some kind of caching;
Additionally, when I added my Control to the Control Center, it was able to display normally, and the only issue was with the Control Gallery
Attempted method:
-Using the system SF Symbol, it works fine and can be displayed normally in the control gallery after recompilation. However, once I switch another SF Symbols, the icons in the control gallery do not update after recompilation and installation
-Restarting the device, the same issue still persists
Is this a system bug or did I make a mistake? Looking forward to someone helping, thank you
My Code:
@available(iOSApplicationExtension 18.0, *)
struct MySearchControlWidget: ControlWidget {
let kind = "MySearchControlWidget"
let title = "My Title"
var body: some ControlWidgetConfiguration {
let intent = MyCommonButtonControlWidgetIntent()
StaticControlConfiguration(kind: kind) {
ControlWidgetButton(action: intent) {
Label("\(title)", image:"my_custom_symbol_name")
}
}
.displayName("\(title)")
}
}