We have widget snapshot tests using XCTest as shown below:
func testHomeWidgetView() {
let widgetView = HomeWidgetView(
state: .done,
text: "All done!"
).frame(width: 170, height: 170)
assertSnapshot(matching: widgetView, as: .image)
}
}
Is it possible to apply a tint to the widgets in snapshot tests like a user can from their home screen in iOS 18? We'd like to capture snapshots of our widget while tinted via the home screen.
Post
Replies
Boosts
Views
Activity
I'm trying to use a custom system image for my App Shortcut:
AppShortcut(
intent: AppOpenIntent(),
phrases: ["Open \(.applicationName)"],
shortTitle: "Open App",
systemImageName: "custom.image"
)
I've added custom.image to Images.xcassets for my project, but the shortcuts icon is always blank in the Shortcuts app. Is it possible to use custom system images for app shortcuts?