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.
-
This is a generic template generator.
Declaration
Swift
private func _makeTemplateObject(for inComplication: CLKComplication) -> CLKComplicationTemplate?Parameters
forThe 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
forThe 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
forThe 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
forThe complication we’re generating this for.
Return Value
a Complication Template object.
-
This sets the current timeline entry for the complication.
Declaration
Swift
func getCurrentTimelineEntry(for inComplication: CLKComplication, withHandler inHandler: @escaping (CLKComplicationTimelineEntry?) -> Void)Parameters
forThe complication we’re generating this for.
withHandlerThe inHandler method to be called.
-
This sets the supported placeholder.
Declaration
Swift
public func getPlaceholderTemplateForComplication(complication inComplication: CLKComplication, withHandler inHandler: @escaping (CLKComplicationTemplate?) -> Void)Parameters
complicationThe complication we’re generating this for.
withHandlerThe 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
forThe complication we’re generating this for.
beforeThe date, before which the entries should be provided.
limitThe number of entries to provide.
withHandlerThe 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
forThe complication we’re generating this for.
afterThe date, after which the entries should be provided.
limitThe number of entries to provide.
withHandlerThe 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
forThe complication we’re generating this for.
withHandlerThe 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
complicationThe complication we’re generating this for.
withHandlerThe 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
forThe complication we’re generating this for.
withHandlerThe 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
forThe complication we’re generating this for.
withHandlerThe 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
forThe complication we’re generating this for.
withHandlerThe inHandler method to be called.
-
This returns the (nonexistent) refresh period.
Declaration
Swift
func getNextRequestedUpdateDateWithHandler(handler inHandler: (NSDate?) -> Void)Parameters
withHandlerThe inHandler method to be called.
View on GitHub
CGA_ComplicationController Class Reference