Currently, my code only updates when first launching (in this case, booting Apple Watch). I want the current time to automatically update every minute, so it could be read as h:mm a.
if complication.family == .utilitarianLarge {
let template = CLKComplicationTemplateUtilitarianLargeFlat()
let currentDateTime = Date()
let formatter = DateFormatter()
formatter.dateFormat = "h:mm a"
let dateTimeString = formatter.string(from: currentDateTime)
let timeLineText = dateTimeString
template.textProvider = CLKSimpleTextProvider(text: "\(timeLineText)")
let timelineEntry = CLKComplicationTimelineEntry(date: currentDateTime, complicationTemplate: template)
handler(timelineEntry)
}
For more context, this is a complication for the Utility Large watch face.