Questions tagged [catransaction]

CATransaction allows you to make batch updates to the Core Animation render tree, and it also allows to trigger implicit animations just by setting layer properties inside of a CATransaction.

CATransaction allows you to make batch updates to the Core Animation render tree. It is most used to override default animation timing functions, durations, etc. or to add a completion block to an animation that doesn't expose one explicitly.

CATransaction allows to trigger implicit animations just by setting layer properties inside of a transaction block. Animating the position of a layer in Objective C:

[CATransaction begin];
[CATransaction setAnimationDuration:0.5];
layer.position = newPosition;
[CATransaction commit];

or the same in Swift:

CATransaction.begin()
CATransaction.setAnimationDuration(0.5)
layer.position = newPosition
CATransaction.commit()

For more information, see the Apple Documentation for CATransaction.

76 questions
0
votes
2 answers

CALayer - animating layer size blocks animation from running

I have a method in which a bunch of layers are positioned, and a single "activated" layer (basically a layer that the user has clicked on) is both positioned and resized at the same time. All the layers, including the activated layer are sublayers…
indragie
  • 18,002
  • 16
  • 95
  • 164
0
votes
1 answer

CAShapeLayer Path Animation

I'm trying to animate a path change on a particular shape. I can manually change without animation by replacing this code with a simple .path [cgpath] setter. However, I want to animate the change for aesthetics. When this code executes, there is…
0
votes
2 answers

Swift 3 How to correctly write Completion Handler Block

I am new to Xcode and programming languages and I need your help. I am working on a Message application and I'm unable to use a Completion Handler Block. Here is my code : @IBAction func SendButton(_ sender: AnyObject) { if…
0
votes
1 answer

Behave of nested CATransaction?

The code below will update the backgroundColor immediately after the commit. [CATransaction begin]; self.view.backgroundColor = [UIColor redColor]; [CATransaction commit]; sleep(5); But with nested explicit CATransactions, screen update only when…
Karl
  • 665
  • 4
  • 19
0
votes
2 answers

unable to slow down animation speed in ios

I want to slow down animation speed when it is going to end. I am going through this code. [CATransaction begin]; CABasicAnimation *rotationAnimation; rotationAnimation = [CABasicAnimation…
Mrugesh Tank
  • 3,495
  • 2
  • 29
  • 59
0
votes
0 answers

Running multiple CAKeyframeAnimations at the same time

So i have 2 CAkeyframeanimations on different layers and i want them to run simultaneously. Previously i tried running them from using dispatch_async. However it didn't worked and the animation were still running in sequence. After a bit of search…
Win Coder
  • 6,628
  • 11
  • 54
  • 81
0
votes
0 answers

Animated size modification using AHEasing in Xcode

I'm trying to make a view change size using AHEasing by WarrenM https://github.com/warrenm/AHEasing I have the point to point animation working, but the re-sizing doesn't seem to work. I'm pretty new at using AHEasing so I'm not sure what mistake…
PhilBlais
  • 1,076
  • 4
  • 13
  • 36
0
votes
1 answer

CALayer.opacity not animating inside CATransaction

I'm trying to animate a change in the opacity of a CALayer using a CATransaction, but it isn't working: [CATransaction begin]; [CATransaction setAnimationDuration:3]; [CATransaction setCompletionBlock:^{ NSLog(@"ENTERING COMPLETION…
hkatz
  • 951
  • 11
  • 21
0
votes
2 answers

afterDelay:0 is there a better solution?

• My general goal My goal is to load some data in a view-based Table View and perform some operations (for the display of the Table View) at the end of loading to scroll to the top of the Table View. • Some more details During the loading, a lot…
Colas
  • 3,473
  • 4
  • 29
  • 68
0
votes
2 answers

How to slow MKMapCamera movement?

I am coding in iOS. I have an NSArray, which contains a few MKMapCameras. I want to display MKMapCameras from the array one after another. I put a while loop and used [self.mapView setCamera:nextCamera animated:YES]; However, this is only showing…
user2734323
  • 706
  • 1
  • 8
  • 19
0
votes
2 answers

animated circle on map with iOS 7

I am using YHAnimatedCircleView (http://yickhong-ios.blogspot.it/2012/04/animated-circle-on-mkmapview.html) to display an animated circle on a map. It works well with iOS6, while I am experiencing some problems with iOS7. The circle appears after a…
user2477825
  • 69
  • 1
  • 7
0
votes
1 answer

Animating and removing an NSImageView object failed?

My app situation: I am now having an app displaying a dynamic picture. And I want to capture its current image and save it to disc. My goal: I am working on an animated visual effect: add an image view on top, and then animates it from its origin…
Andrew Chang
  • 1,289
  • 1
  • 18
  • 38
0
votes
1 answer

Undefined delay issue of ipad views animation

I have an issue with the following code. When I execute it, There is a undefined delay withing first [CATransaction commit] and CompletionBlock:. No idea what is happening there. This only happen when the app run on the device. This is the time…
chinthakad
  • 939
  • 2
  • 16
  • 31
0
votes
3 answers

Core Animation Warning: "uncommitted CATransaction"

I am getting the following warning with Device only: CoreAnimation: warning, deleted thread with uncommitted CATransaction; created by: 0 QuartzCore 0x3763c65d + 220 1 QuartzCore …
Nikita P
  • 4,226
  • 5
  • 31
  • 55
0
votes
3 answers

CATransaction + UIView on iOS 3.2

I need to implement very custom animation on iOS 3.2 So, neither I can't use block animations nor UIKit animations before 4.0. I try to use Core Animation. Here's my code: [CATransaction begin]; [CATransaction setAnimationDuration:…
QuickNick
  • 1,921
  • 2
  • 15
  • 30