Skip to content

Instantly share code, notes, and snippets.

@pedroortizordep
Last active April 27, 2018 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedroortizordep/de7ff3bcd4e010d634f0bfdd1361018b to your computer and use it in GitHub Desktop.
Save pedroortizordep/de7ff3bcd4e010d634f0bfdd1361018b to your computer and use it in GitHub Desktop.
func createTimeLineEntry(headerText: String, bodyText: String, date: Date) -> CLKComplicationTimelineEntry {
let template = CLKComplicationTemplateModularLargeStandardBody()
let swift = UIImage(named: "swift")
template.headerImageProvider =
CLKImageProvider(onePieceImage: swift!)
template.headerTextProvider = CLKSimpleTextProvider(text: headerText)
template.body1TextProvider = CLKSimpleTextProvider(text: bodyText)
let entry = CLKComplicationTimelineEntry(date: date,
complicationTemplate: template)
return(entry)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment