CKAsyncTransactionGroup Class Reference

Inherits from NSObject
Declared in CKAsyncTransactionGroup.h

Overview

A group of transaction container layers, for which the current transactions are committed together at the end of the next runloop tick.

+ mainTransactionGroup

The main transaction group is scheduled to commit on every tick of the main runloop.

+ (instancetype)mainTransactionGroup

Declared In

CKAsyncTransactionGroup.h

– addTransactionContainer:

Add a transaction container to be committed.

- (void)addTransactionContainer:(CALayer *)containerLayer

Parameters

containerLayer

A layer containing a transaction to be commited. May or may not be a container layer.

Declared In

CKAsyncTransactionGroup.h

– removeTransactionContainer:

Remove a transaction container that no longer has pending transactions. All layers added with addTransactionContainer: should be removed with removeTransactionContainer: once all its transactions have been completed or canceled for flushPendingTransactions: to work correctly. Only one call to removeTransactionContainer: is needed to remove the layer, even if addTransactionContainer: has been called multiple times.

- (void)removeTransactionContainer:(CALayer *)containerLayer

Parameters

containerLayer

A layer for which all transactions have been completed or canceled.

Declared In

CKAsyncTransactionGroup.h

– flushPendingTransactions:

Force layout and display and signal when all the pending transactions have completed. When the app is in background mode, UIKit suspends layout and display calls until it takes a screenshot. Call flushPendingTransactions to force async layers to render and display a consistent UI for the snapshot.

- (void)flushPendingTransactions:(dispatch_block_t)completionHandler

Parameters

completionHandler

A block that is called on the main thread after all transactions have completed.

Declared In

CKAsyncTransactionGroup.h