Custom watchOS Live Activity

I have followed this video on implementing a custom view for the watchOS 11 Smart Stack Live Activities. However, the UI of my iOS app keeps showing up on the watchOS.

`struct widgetLiveActivity: Widget { @Environment(.activityFamily) var activityFamily

var body: some WidgetConfiguration {
ActivityConfiguration(for: widgetAttributes.self) { context in
switch activityFamily {
case .small, _:
Text("WatchOS UI")
case .medium:
Text("iOS UI")
.activitySystemActionForegroundColor(Color.black)
} dynamicIsland: { context in ... }
.supplementalActivityFamilies([.small, .medium])
}

}`

Hi there! Thank you for customizing your Live Activity view for watchOS.

I wonder if the issue is this line:

case .small, _:

I think the compiler may be giving you a warning about that.

Try changing that to:

case .small:

and adding this at the end of your switch:

@unknown default:
Text("iOS UI")
.activitySystemActionForegroundColor(Color.black)
Custom watchOS Live Activity
 
 
Q