Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Edit Complication name in Watch app of iPhone?

I am trying to create a WidgetKit based complication for watchOS 9 on XCode 14. Everything works fine but the Complication name in the Watch app of the iPhone shows COMPLICATION_TYPE_EDIT_LABEL_(NULL)_COMPANION

How do I change it to display my app's name?

Steps to reproduce : Create a new project on Xcode 14 -> Add new Watch App Target -> Add new Widget Extension target for watchOS.

enter image description here

like image 481
Kamal Kumar Lakshmanan Avatar asked Oct 17 '25 03:10

Kamal Kumar Lakshmanan


1 Answers

There is a solution. It comes from ClockKit framework. It’s not mentioned in new APIs, but it works. In your watchOS target create file ComplicationController.swift with the following content:

import ClockKit
class ComplicationController: NSObject, CLKComplicationDataSource {
    func complicationDescriptors() async -> [CLKComplicationDescriptor] { [] }
    func currentTimelineEntry(for complication: CLKComplication) async -> CLKComplicationTimelineEntry? { nil }
}

Then add this field in the Info.plist of watchOS target:

ClockKit Complication - Principal Class --> $(PRODUCT_MODULE_NAME).ComplicationController

enter image description here

The result: enter image description here

I hope there will be a better solution later on, because now it's buggy and works not as it should be.

like image 153
mosariot Avatar answered Oct 19 '25 19:10

mosariot



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!