Class: CATransaction

Inherits:
NSObject show all

Overview

CATransaction is the Core Animation mechanism for batching multiple layer-tree operations into atomic updates to the render tree. Every modification to a layer tree must be part of a transaction. Nested transactions are supported.

Class Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Class Method Details

+ (CFTimeInterval) animationDuration

Returns the animation duration used by all animations within this transaction group. This is a convenience method that returns an NSNumber containing the seconds for the valueForKey: value returned by the kCATransactionAnimationDuration key.

Returns:

  • (CFTimeInterval)

    An interval of time used as the duration.

+ (CAMediaTimingFunction) animationTimingFunction

Returns the timing function used for all animations within this transaction group. This is a convenience method that returns the CAMediaTimingFunction for the valueForKey: value returned by the kCATransactionAnimationTimingFunction key.

Returns:

+ (Object) begin

Begin a new transaction for the current thread. The transaction is nested within the thread’s current transaction, if there is one.

Returns:

+ (Object) commit

Commit all changes made during the current transaction.

Returns:

+ (Object) completionBlock

Returns the completion block object. See setCompletionBlock: for a description of the role of the completion block object.

Returns:

+ (Boolean) disableActions

Returns whether actions triggered as a result of property changes made within this transaction group are suppressed. This is a convenience method that returns the boolValue for the valueForKey: value returned by the kCATransactionDisableActions key.

Returns:

  • (Boolean)

    YES if actions are disabled.

+ (Object) flush

Flushes any extant implicit transaction. Delays the commit until any nested explicit transactions have completed.Flush is typically called automatically at then end of the current runloop, regardless of the runloop mode. If your application does not have a runloop, you must call this method explicitly. However, you should attempt to avoid calling flush explicitly. By allowing flush to execute during the runloop your application will achieve better performance, atomic screen updates will be preserved, and transactions and animations that work from transaction to transaction will continue to function.

Returns:

+ (Object) lock

Attempts to acquire a recursive spin-lock lock, ensuring that returned layer values are valid until unlocked. Core Animation uses a data model that promises not to corrupt the internal data structures when called from multiple threads concurrently, but not that data returned is still valid if the property was valid on another thread. By locking during a transaction you can ensure data that is read, modified, and set is correctly managed.

Returns:

+ (Object) setAnimationDuration(duration)

Sets the animation duration used by all animations within this transaction group. This is a convenience method that sets an NSNumber containing the seconds for the valueForKey: value of the kCATransactionAnimationDuration key.

Parameters:

  • duration (CFTimeInterval)

    An interval of time used as the duration.

Returns:

+ (Object) setAnimationTimingFunction(function)

Sets the timing function used for all animations within this transaction group. This is a convenience method that sets the CAMediaTimingFunction for the valueForKey: value of the kCATransactionAnimationTimingFunction key.

Parameters:

Returns:

+ (Object) setCompletionBlock(block)

Sets the completion block object. The completion block object that is guaranteed to be called (on the main thread) as soon as all animations subsequently added by this transaction group have completed (or have been removed.) If no animations are added before the current transaction group is committed (or the completion block is set to a different value,) the block will be invoked immediately.

Parameters:

  • block

    A block object called when animations for this transaction group are completed.The block object takes no parameters and returns no value.

Returns:

+ (Object) setDisableActions(flag)

Sets whether actions triggered as a result of property changes made within this transaction group are suppressed. This is a convenience method that invokes setValue:forKey: with an NSNumber containing a YES for the kCATransactionDisableActions key.

Parameters:

  • flag (Boolean)

    YES, if actions should be disabled.

Returns:

+ (Object) setValue(anObject, forKey:key)

Sets the arbitrary keyed-data for the specified key. Nested transactions have nested data scope; setting a key always sets it in the innermost scope.

Parameters:

  • anObject (Object)

    The value for the key identified by key.

  • key (String)

    The name of one of the receiver's properties.

Returns:

+ (Object) unlock

Relinquishes a previously acquired transaction lock.

Returns:

+ (Object) valueForKey(key)

Returns the arbitrary keyed-data specified by the given key. Nested transactions have nested data scope. Requesting a value for a key first searches the innermost scope, then the enclosing transactions.

Parameters:

  • key (String)

    The name of one of the receiver's properties.

Returns:

  • (Object)

    The value for the data specified by the key.