Contents

init(identifier:title:subtitle:)

Creates an instance on behalf of the currently foregrounded app.

Declaration

init(identifier: String, title: String, subtitle: String)

Parameters

  • identifier:

    The task identifier.

  • title:

    The localized title displayed to a person before the task begins running.

  • subtitle:

    The localized subtitle displayed to a person before the task begins running.

Discussion

Apps and their extensions need to use this method to initialize any tasks due to the underlying association to the currently foregrounded app. Note that earliestBeginDate is ignored by the scheduler in favor of NSDate.now.

The identifier must leverage a base wildcard notation, where the prefix of the identifier must at least contain the bundle ID of the submitting application, followed by optional semantic context, and finally ending with .*. An example: <MainBundle>.<SemanticContext>.* transforms to com.foo.MyApplication.continuedProcessingTask.*. Thus, a submitted identifier is of the form com.foo.MyApplication.continuedProcessingTask.HD830D.