Skip to content

Instantly share code, notes, and snippets.

@andrew-codechimp
Created March 3, 2021 14:36
Show Gist options
  • Select an option

  • Save andrew-codechimp/3d94c6516085452dcd67ed24efebc36f to your computer and use it in GitHub Desktop.

Select an option

Save andrew-codechimp/3d94c6516085452dcd67ed24efebc36f to your computer and use it in GitHub Desktop.
func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void) {
let simpleTextProvider1 = CLKSimpleTextProvider(
text: "Publication")
let simpleTextProvider2 = CLKSimpleTextProvider(
text: "Latest Headline")
switch (complication.family) {
case (.graphicRectangular):
handler(CLKComplicationTemplateGraphicRectangularStandardBody(
headerTextProvider: simpleTextProvider1,
body1TextProvider: simpleTextProvider2))
case (_):
handler(nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment