UAAutomation

@interface UAAutomation : NSObject

Manager class for scheduling actions.

  • Schedules actions.

    Declaration

    Objective-C

    - (void)scheduleActions:(nonnull UAActionScheduleInfo *)scheduleInfo
          completionHandler:
              (nullable void (^)(UAActionSchedule *_Nullable))completionHandler;

    Swift

    func scheduleActions(_ scheduleInfo: UAActionScheduleInfo, completionHandler: ((UAActionSchedule?) -> Void)? = nil)

    Parameters

    scheduleInfo

    The schedule information.

    completionHandler

    The completion handler when the action is scheduled. If the schedule info is invalid, the action schedule will be nil.

  • Cancels a schedule with the given identifier.

    Declaration

    Objective-C

    - (void)cancelScheduleWithIdentifier:(nonnull NSString *)identifier;

    Swift

    func cancelSchedule(withIdentifier identifier: String)

    Parameters

    identifier

    A schedule identifier.

  • Cancels all schedules of the given group.

    Declaration

    Objective-C

    - (void)cancelSchedulesWithGroup:(nonnull NSString *)group;

    Swift

    func cancelSchedules(withGroup group: String)

    Parameters

    group

    A schedule group.

  • Cancels all schedules.

    Declaration

    Objective-C

    - (void)cancelAll;

    Swift

    func cancelAll()
  • Gets the schedule with the given identifier.

    Declaration

    Objective-C

    - (void)getScheduleWithIdentifier:(nonnull NSString *)identifier
                    completionHandler:
                        (nonnull void (^)(UAActionSchedule *_Nullable))
                            completionHandler;

    Swift

    func getScheduleWithIdentifier(_ identifier: String, completionHandler: @escaping (UAActionSchedule?) -> Void)

    Parameters

    identifier

    A schedule identifier.

    completionHandler

    The completion handler with the result.

  • Gets all schedules.

    Declaration

    Objective-C

    - (void)getSchedules:
        (nonnull void (^)(NSArray<UAActionSchedule *> *_Nonnull))completionHandler;

    Swift

    func getSchedules(_ completionHandler: @escaping ([UAActionSchedule]) -> Void)

    Parameters

    completionHandler

    The completion handler with the result.

  • Gets all schedules of the given group.

    Declaration

    Objective-C

    - (void)getSchedulesWithGroup:(nonnull NSString *)group
                completionHandler:
                    (nonnull void (^)(NSArray<UAActionSchedule *> *_Nonnull))
                        completionHandler;

    Swift

    func getSchedulesWithGroup(_ group: String, completionHandler: @escaping ([UAActionSchedule]) -> Void)

    Parameters

    group

    The schedule group.

    completionHandler

    The completion handler with the result.