YapDatabaseManualViewTransaction

@interface YapDatabaseManualViewTransaction : YapDatabaseViewTransaction

Welcome to YapDatabase!

The project page has a wealth of documentation if you have any questions. https://github.com/yapstudios/YapDatabase

If you’re new to the project you may want to check out the wiki https://github.com/yapstudios/YapDatabase/wiki

YapDatabaseView is an extension designed to work with YapDatabase. It gives you a persistent sorted view of a configurable subset of your data.

For more information, please see the wiki article about Views: https://github.com/yapstudios/YapDatabase/wiki/Views

You access this class within a regular transaction. For example:

[databaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction){

 topUsaSale = [[transaction ext:@"myView"] objectAtIndex:0 inGroup:@"usa"]

}];

Keep in mind that the YapDatabaseViewTransaction object is linked to the YapDatabaseReadTransaction object. So don’t try to use it outside the transaction block (cause it won’t work).

  • Adds the tuple to the end of the group (greatest index possible).

    The operation will fail if the already exists in the view, regardless of whether it’s in the given group, or another group.

    @return YES if the operation was successful. NO otherwise.

    Declaration

    Objective-C

    - (BOOL)addKey:(nonnull NSString *)key
        inCollection:(nullable NSString *)collection
             toGroup:(nonnull NSString *)group;

    Swift

    func addKey(_ key: String, inCollection collection: String?, toGroup group: String) -> Bool
  • Inserts the tuple in the group, placing it at the given index.

    The operation will fail if the already exists in the view, regardless of whether it’s in the given group, or another group.

    @return YES if the operation was successful. NO otherwise.

    Declaration

    Objective-C

    - (BOOL)insertKey:(nonnull NSString *)key
         inCollection:(nullable NSString *)collection
              atIndex:(NSUInteger)index
              inGroup:(nonnull NSString *)group;

    Swift

    func insertKey(_ key: String, inCollection collection: String?, at index: UInt, inGroup group: String) -> Bool
  • Removes the item currently located at the index in the given group.

    @return YES if the operation was successful (the group + index was valid). NO otherwise.

    Declaration

    Objective-C

    - (BOOL)removeItemAtIndex:(NSUInteger)index inGroup:(nonnull NSString *)group;

    Swift

    func removeItem(at index: UInt, inGroup group: String) -> Bool
  • Removes the tuple from its index within the given group.

    The operation will fail if the isn’t currently a member of the group.

    @return YES if the operation was successful. NO otherwise.

    Declaration

    Objective-C

    - (BOOL)removeKey:(nonnull NSString *)key
         inCollection:(nullable NSString *)collection
            fromGroup:(nonnull NSString *)group;

    Swift

    func removeKey(_ key: String, inCollection collection: String?, fromGroup group: String) -> Bool
  • Removes all tuples from the given group.

    Declaration

    Objective-C

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

    Swift

    func removeAllItems(inGroup group: String)