CGA_ComplicationController

class CGA_ComplicationController : NSObject
extension CGA_ComplicationController: CLKComplicationDataSource

This adds support for the various complications provided by this app.

These complications are about as simple as you can get. They just bring up the app. No state info is displayed.

Private Methods

  • This is a generic template generator.

    Declaration

    Swift

    private func _makeTemplateObject(for inComplication: CLKComplication) -> CLKComplicationTemplate?

    Parameters

    for

    The complication we’re generating this for.

    Return Value

    a Complication Template object.

  • This is a modular template generator.

    Declaration

    Swift

    private func _makeModularTemplateObject(for inComplication: CLKComplication) -> CLKComplicationTemplate?

    Parameters

    for

    The complication we’re generating this for.

    Return Value

    a Complication Template object.

  • This is a utilitarian template generator.

    Declaration

    Swift

    private func _makeUtilitarianTemplateObject(for inComplication: CLKComplication) -> CLKComplicationTemplate?

    Parameters

    for

    The complication we’re generating this for.

    Return Value

    a Complication Template object.

  • This is a graphic template generator.

    Declaration

    Swift

    private func _makeGraphicTemplateObject(for inComplication: CLKComplication) -> CLKComplicationTemplate?

    Parameters

    for

    The complication we’re generating this for.

    Return Value

    a Complication Template object.

CLKComplicationDataSource Conformance

  • This sets the current timeline entry for the complication.

    Declaration

    Swift

    func getCurrentTimelineEntry(for inComplication: CLKComplication, withHandler inHandler: @escaping (CLKComplicationTimelineEntry?) -> Void)

    Parameters

    for

    The complication we’re generating this for.

    withHandler

    The inHandler method to be called.

  • This sets the supported placeholder.

    Declaration

    Swift

    public func getPlaceholderTemplateForComplication(complication inComplication: CLKComplication, withHandler inHandler: @escaping (CLKComplicationTemplate?) -> Void)

    Parameters

    complication

    The complication we’re generating this for.

    withHandler

    The inHandler method to be called.

  • This is called to populate a set of timeline entries (should never be called).

    Declaration

    Swift

    func getTimelineEntries(for inComplication: CLKComplication, before inDate: Date, limit inLimit: Int, withHandler inHandler: @escaping ([CLKComplicationTimelineEntry]?) -> Void)

    Parameters

    for

    The complication we’re generating this for.

    before

    The date, before which the entries should be provided.

    limit

    The number of entries to provide.

    withHandler

    The inHandler method to be called.

  • This is called to populate a set of timeline entries (should never be called).

    Declaration

    Swift

    func getTimelineEntries(for inComplication: CLKComplication, after inDate: Date, limit inLimit: Int, withHandler inHandler: @escaping ([CLKComplicationTimelineEntry]?) -> Void)

    Parameters

    for

    The complication we’re generating this for.

    after

    The date, after which the entries should be provided.

    limit

    The number of entries to provide.

    withHandler

    The inHandler method to be called.

  • This sets the template object for the complication when in “always on” mode.

    Declaration

    Swift

    func getAlwaysOnTemplate(for inComplication: CLKComplication, withHandler inHandler: @escaping (CLKComplicationTemplate?) -> Void)

    Parameters

    for

    The complication we’re generating this for.

    withHandler

    The inHandler method to be called.

  • This sets the supported placeholder for the composer.

    Declaration

    Swift

    func getLocalizableSampleTemplate(for inComplication: CLKComplication, withHandler inHandler: @escaping (CLKComplicationTemplate?) -> Void)

    Parameters

    complication

    The complication we’re generating this for.

    withHandler

    The inHandler method to be called.

  • Sets the (non-existent) end date for the (non-existent) timeline.

    Declaration

    Swift

    func getTimelineEndDate(for inComplication: CLKComplication, withHandler inHandler: @escaping (Date?) -> Void)

    Parameters

    for

    The complication we’re generating this for.

    withHandler

    The inHandler method to be called.

  • This is called to say whether or not to display the complication in lock.

    Declaration

    Swift

    func getPrivacyBehavior(for inComplication: CLKComplication, withHandler inHandler: @escaping (CLKComplicationPrivacyBehavior) -> Void)

    Parameters

    for

    The complication we’re generating this for.

    withHandler

    The inHandler method to be called.

  • This sets the supported Time Travel directions (We don’t do any).

    Declaration

    Swift

    func getSupportedTimeTravelDirections(for inComplication: CLKComplication, withHandler inHandler: @escaping (CLKComplicationTimeTravelDirections) -> Void)

    Parameters

    for

    The complication we’re generating this for.

    withHandler

    The inHandler method to be called.

  • This returns the (nonexistent) refresh period.

    Declaration

    Swift

    func getNextRequestedUpdateDateWithHandler(handler inHandler: (NSDate?) -> Void)

    Parameters

    withHandler

    The inHandler method to be called.