As title says, at end of a watch Event complication, ModularLarge, as Apple's Calendar complication does, say Event is 7-7:10pm, then next event is 8pm. So at Time Travel, or even on watch face itself live, when Event end Time occurs, I do not step/display the next event(I have event in the array note). Think I am just missing something. Note: I am a bit new at this. Here is the code I have.
func getTimelineEntriesForComplication(complication: CLKComplication, afterDate date: NSDate, limit: Int, withHandler handler: (([CLKComplicationTimelineEntry]?) -> Void)) {
// Call the handler with the timeline entries after to the given date
var timeLineEntryArray = [CLKComplicationTimelineEntry]()
if allEvents.count > 0 {
for (index, title) in allEvents.enumerate() {
let item = allEvents[index]
let startDate = item.startDate
let endDate = item.endDate
let title = item.title
//let entry = createTimeLineEntry2(timeString, body1Text: timeLineText[index], body2Text: timeUntilArray[index], date: nextDate)
let entry = createTimeLineEntry2(timeString, body1Text: title, body2Text: timeUntil, startDate: startDate)
timeLineEntryArray.append(entry)
} //end for loop...
} //end If allEvents.count > 0 we have events
handler(timeLineEntryArray)
}
so at watch time, and TimeTravel of 7:11 should display the 8pm Event, and then I desire to delta time to shot time until that event. so "-49 minutes" with this code that works:
func createTimeLineEntry2(headerText: String, body1Text: String, body2Text: String, startDate: NSDate) -> CLKComplicationTimelineEntry {
template.body2TextProvider = CLKRelativeDateTextProvider(date: startDate,
style: .Offset,
units: NSCalendarUnit.Hour.union(.Minute))
template.body2TextProvider!.tintColor = UIColor.yellowColor()
template.tintColor = UIColor.yellowColor()
let entry = CLKComplicationTimelineEntry(date: startDate, complicationTemplate: template)
return(entry)
}
Lastly, can we set the tint(color) of the body2TextProvider?
thank you so much. Mike
here is a link to picture, this event ended at 9:10 am, so watch shodld show the 12 pm event now! http://pics.derr.ws/watch.png