There is no complication compiled on my Apple Watch.
- I simply duplicated target for my iOS widget to extend it to watchOS.
- I have changed Targetet Device Families to Apple Watch
- I have changed Base SDK to watchOS
- i have changed bundle identifier and provisionings
- I have embedded complication target to my watch app target.
Everything is compiled correctly. No issues, warning, errors. But when I try to add complication to my watch face, it doesn't exist on the list. Why?
Am I missing something?
This is my Widget code:
import WidgetKit
import SwiftUI
struct CurrentMonth: Widget {
@available(watchOS 9.0, *)
var families: [WidgetFamily] {
#if os(watchOS)
return [.accessoryInline, .accessoryCircular, .accessoryRectangular]
#else
if #available(iOS 16.0, *) {
return [.systemSmall, .systemMedium, .systemLarge, .systemExtraLarge, .accessoryInline, .accessoryCircular, .accessoryRectangular]
} else {
return [.systemSmall, .systemMedium, .systemLarge, .systemExtraLarge]
}
#endif
}
@available(watchOS 9.0, *)
var body: some WidgetConfiguration {
StaticConfiguration(
kind: "WidgetCurrentMonth",
provider: MonthTimeline(), content: { entry in
WidgetCurrentMonthView(entry: entry)
})
.configurationDisplayName("widget.currentmonth.title".localized)
.description("widget.currentmonth.description".localized)
.supportedFamilies(families)
}
}
@available(watchOS 9.0, *)
struct WidgetCurrentMonthView: View {
let entry: LastMonthEntry
@Environment(\.widgetFamily) var family
var body: some View {
HStack {
Image.briefcase
Text("abcd")
}
}
}
Code is shared for both: my iOS widget target and my watchOS complication target.
Additionally:
I have downloaded example project from Apple:
and tried to install it on watch simulator and on watch device and it also doesn't work. Why?
Watch face I am trying to use:
My App is called Field Service Watch so should be between Compass and Heart Rate