私は現在、watchOS 2アプリケーションの複雑さを設定しています。watchOSの複雑さに画像を表示するには
私は合併症の3つの異なる種類を提供したい:
- 功利小さな
- モジュラーsmallist項目
- 単に私のアプリのアイコンを表示する必要がある円形の小さな
すべてのこれらの合併症の種類画像。私ClockKitクラスでは、私は次のメソッド実装されています:
func getCurrentTimelineEntryForComplication(complication: CLKComplication, withHandler handler: (CLKComplicationTimelineEntry?) -> Void) {
if complication.family == .CircularSmall {
let template = CLKComplicationTemplateCircularSmallRingImage()
template.imageProvider = CLKImageProvider(onePieceImage: UIImage(named: "app_icon")!)
let timelineEntry = CLKComplicationTimelineEntry(date: NSDate(), complicationTemplate: template)
handler(timelineEntry)
} else if complication.family == .UtilitarianSmall{
let template = CLKComplicationTemplateUtilitarianSmallRingImage()
template.imageProvider = CLKImageProvider(onePieceImage: UIImage(named: "app_icon")!)
let timelineEntry = CLKComplicationTimelineEntry(date: NSDate(), complicationTemplate: template)
handler(timelineEntry)
} else if complication.family == .ModularSmall {
let template = CLKComplicationTemplateModularSmallRingImage()
template.imageProvider = CLKImageProvider(onePieceImage: UIImage(named: "app_icon")!)
let timelineEntry = CLKComplicationTimelineEntry(date: NSDate(), complicationTemplate: template)
handler(timelineEntry)
} else {
handler(nil)
}
}
を私は私のアイデアを実現する適切な方法だか分からないので、私はちょうど私の合併症として画像を表示するためのコードを知りたいのですが。誰も私がこれをどのように達成できるかを知っていますか?
詳細な回答ありがとうございます。おそらく私はすでにこれらのメソッドを実装していることを明確にしていませんでした。それ以外の場合はアプリケーションを構築できませんでした。あなたが提案したWWDCセッションビデオを見ていきます。 – fredpi
@ pi1000 - 設定スクリーンショットで答えを更新しました。私が付けた設定を含め、あなたがやったすべてのことを列挙する必要があると思います。 –
ええ、ありがとう、しかしまだいくつかの誤解。私は、複雑な丸形の円を見ていますが、私はそのようなテンプレートを持っていないと私はイメージとして私のアプリのアイコンを使用できるかどうかを知りたいです。 – fredpi