SKYDeleteRecordsOperation

@interface SKYDeleteRecordsOperation : SKYDatabaseOperation

is a subclass of that implements records deletion in Skygear. Use this operation to delete multiple existing records from the database.

  • Instantiates an instance of with a list of records to be deleted from database.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithRecordIDsToDelete:
        (nonnull NSArray<SKYRecordID *> *)recordIDs;

    Swift

    init(recordIDsToDelete recordIDs: [SKYRecordID])

    Parameters

    recordIDs

    An array of records to be deleted from database.

  • Creates and returns an instance of with a list of records to be deleted from database.

    Declaration

    Objective-C

    + (nonnull instancetype)operationWithRecordIDsToDelete:
        (nonnull NSArray<SKYRecordID *> *)recordIDs;

    Parameters

    recordIDs

    An array of records to be deleted from database.

  • Sets or returns an array of records to be from from database.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic)
        NSArray<SKYRecordID *> *_Nonnull recordIDs;

    Swift

    var recordIDs: [SKYRecordID] { get set }
  • Sets whether the operation should be treated as an atomic operation. An atomic operation saves all the modifications should there be no errors. If some of the s are deleted successfully while some are not, the database will treat the delete as not happened at all.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL atomic;

    Swift

    var atomic: Bool { get set }
  • Sets or returns a block to be called when progress information is available for deleting each record.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) void (^_Nullable)
        (SKYRecordID *_Nullable, double) perRecordProgressBlock;

    Swift

    var perRecordProgressBlock: ((SKYRecordID?, Double) -> Void)? { get set }
  • Sets or returns a block to be called when the delete operation for individual record is completed. If an error occurred during the deletion, the will be specified.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) void (^_Nullable)
        (SKYRecordID *_Nullable, NSError *_Nullable) perRecordCompletionBlock;

    Swift

    var perRecordCompletionBlock: ((SKYRecordID?, Error?) -> Void)? { get set }
  • Sets or returns a block to be called when the entire operation completes. If the entire operation results in an error, the will be specified.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) void (^_Nullable)
        (NSArray<SKYRecordID *> *_Nullable, NSError *_Nullable)
            deleteRecordsCompletionBlock;

    Swift

    var deleteRecordsCompletionBlock: (([SKYRecordID]?, Error?) -> Void)? { get set }