Questions tagged [calayer]

CALayer is a Core Animation class in the Quartz Core framework. It encapsulates the geometry and presentation of a layer. It supports animations of the layer's geometry and its content.

The layer classes are the foundation of Core Animation and provide an abstraction that should be familiar to developers who have used NSView or UIView. Basic layer functionality is provided by the CALayer class, which is the parent class for all types of Core Animation layers.

The CALayer class is the model class for layer-tree objects. It encapsulates the position, size, and transform of a layer, which defines its coordinate system. It also encapsulates the duration and pacing of a layer and its animations by adopting the CAMediaTiming protocol, which defines a layer’s time space.

2853 questions
1
vote
1 answer

Touch Gesture on a CALayer

I am doing some drawing on a CALayer and want to be able to have the user single tap different parts of the drawing and trigger a response. I tried looking into gesture recognizers, and it seems that they need to be tied to a UIView. Any idea how…
lavoy
  • 1,876
  • 3
  • 21
  • 36
1
vote
1 answer

iPhone CALayer's rotation axis

I'm rotating a CALayer on the X axis, but even if it's displaced on the Z axis, it uses the Z = 0 as axis for the rotation? Is there a way of telling it to use the bottom of the plane, as the axis? Thank you!
Andre
  • 4,417
  • 8
  • 32
  • 37
1
vote
3 answers

How to set CATextLayer in video according to frame?

I have try many think but no success yet, My question is that I Have one video on that I was provide a functionality to write text over the video and drag/drop that text over the video now I wand to set CATextlayer on video with propper position…
Dipen Chudasama
  • 3,063
  • 21
  • 42
1
vote
1 answer

iOS update CALayer in UIView animation block

So i have the following function - (void)setMoreMenuHidden:(BOOL)hidden animated:(BOOL)animated completion:(void(^)(BOOL))completion { if (!hidden) { [self.view layoutIfNeeded]; [self.view setNeedsUpdateConstraints]; …
Genhain
  • 1,937
  • 1
  • 19
  • 38
1
vote
1 answer

Shadow doesn't work with UIViewLayer with a mask

I have implemented a UIView with rounded rect only at the top left and top right corners using UIBezierPath. But after that when i add a shadow to the view, it doesn't show the shadow. If i just remove the bezier rounded corners, then the shadow…
1
vote
1 answer

How to reduce the duration of an implicit animation to 0 for a CAReplicatorLayer

I've got a CAReplicatorLayer replicating its sublayer as per expected, but there's a built-in duration to the animation that I want to turn off. In other words I want to see the instantaneous results of replicating the base layer, rather than over…
hkatz
  • 951
  • 11
  • 21
1
vote
1 answer

How to change layer.border.top color?

In iOS, how can I change layer.border.top color? If I change self.layer.borderColor, all the side change. But If I only want to change one side, and keep other three sides as is, what should I do?
seguedestination
  • 419
  • 4
  • 19
1
vote
0 answers

Multiple CALayer instances created by a UIScrollView?

I'm working on a project where I'm using a CAShapeLayer to render a grid behind some content. The problem is that the OS creates multiple instances of this CAShapeLayer subclass, when I'm expecting one. First, I subclassed CAShapeLayer, overriding…
Nate Symer
  • 2,185
  • 1
  • 20
  • 27
1
vote
2 answers

All UIView Transition Animations Stop Working

I have an app who's main view that has 5 modal transitions (presentViewController) and one custom drop down animation ([UIView animateWithDuration:0.15 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^ { ...). For some reason -…
addzo
  • 845
  • 3
  • 13
  • 37
1
vote
0 answers

iOS: How to show all lines in line graph within an small area

I am showing decibel values as line graph while recording an audio in iOS. I am drawing line using UIBezierPath and CALayer. When I stop recording, all the lines in line graph should be shown in an UIView. It should be like miniature of line graph…
iphony
  • 119
  • 9
1
vote
1 answer

How To Apply Complex CALayer Transform Changes?

I need a complex continuous animation of a UIView that involves setting CATransform3D rotation and translation properties that need to be calculated, so a standard animation is no option. I turned to using CALayer animation. And have…
meaning-matters
  • 21,929
  • 10
  • 82
  • 142
1
vote
1 answer

CALayer shadowColor not changing

So I set the shadow of a layer of an UIView correctly the first time (it shows perfectly fine) but when I try to change the color (nothing else, just the layer.shadowColor) it won't update in the view. It still shows the original color. I already…
DemosJarco
  • 587
  • 4
  • 18
1
vote
1 answer

Layer-backed NSView subclass causes z-index issue on its non layer-backed superview

I'm trying to understand how layer-backed NSViews work. I have created the following code inside a playground. import Cocoa import XCPlayground class MyView: NSView { override init(frame: NSRect) { super.init(frame: frame) wantsLayer =…
nstein
  • 339
  • 2
  • 14
1
vote
1 answer

CABasicAnimation animates everything when it should only animate one thing

I made a bunch of little individual pictures, each with a separate CALayer, and they're supposed to fade in and out asynchronously at different rates. Each has a background sublayer and a fill sublayer. A timer runs in the background to animate…
William
  • 23
  • 4
1
vote
1 answer

Mask CALayer with Another CALayer

I'm trying to mask one CALayer(newSticker) with the image of another layer(stickerMask), like so: func placeSticker(location: CGPoint) { let stickerMask = CALayer() stickerMask.contents =…
jwade502
  • 898
  • 1
  • 9
  • 22
1 2 3
99
100