0
Apple Watch AppをComplicationで作成し、Modular Smallをアクティブにしました。私は、次のコードをComplicationController.swiftに追加しましたが、四角形のアイコンしか表示されません。テキストやイメージを入れようとしても何もしません。
ご協力いただきありがとうございます。あなたはそれだけが唯一のあなたが合併症を変更したいときに表示されるテンプレートの一覧に表示されますgetPaceholderTemplete()メソッドでテンプレートを入れ
Apple Watch Complicationアイコンまたはテキスト
func getPlaceholderTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void) {
var template: CLKComplicationTemplate?
switch complication.family {
case .modularSmall:
template = CLKComplicationTemplateModularSmallSimpleText()
(template as! CLKComplicationTemplateModularSmallSimpleText).textProvider = CLKSimpleTextProvider(text: "R")
default:
template = nil
}
handler(template)
}