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
0 answers

Disable some of the animations during device orientation changes

Is there any way to disable rotation animation during changing device orientation portrait/landscape in only one UIView and its subviews. Currently I'm using something like that from this post: override func viewWillTransitionToSize(size: CGSize, …
Marcin Kapusta
  • 5,076
  • 3
  • 38
  • 55
1
vote
0 answers

Determine CALayer energy impact

I am adding several CALayers to my application, and I while they use next to zero CPU on my machine, I notice that they tax the GPU. Currently I use the third party app iStat Menus to monitor GPU power draw. Is there a better way to see how the…
Henrik
  • 3,908
  • 27
  • 48
1
vote
1 answer

CALayer can't be seen

I'm trying to learn swift. So far, my code runs, but it doesn't show a CAlayer I create: class AppDelegate: NSObject, NSApplicationDelegate { var window: NSWindow! var mainview: NSView! var redLayer: CATextLayer! func…
Bill Yan
  • 3,369
  • 4
  • 27
  • 42
1
vote
1 answer

Performance of CAShapeLayer?

From apple's doc and session,I think CAShapeLayer should render in render server when composited.And if shouldRasterize is disabled, the path should render every frame. But when I profile a layer with a very complex path, seems not true. I can see…
Karl
  • 665
  • 4
  • 19
1
vote
1 answer

Making an oval gradient in shape

I am trying to find out how to create an oval gradient which is not a perfect circle. For example an american football/rugby/eye shape instead of a circle. At the moment I have created a CALayer subclass as below which creates a circle. How can I…
StuartM
  • 6,743
  • 18
  • 84
  • 160
1
vote
2 answers

How can I stop CALayers from animating?

I've created a bunch of sublayers within my view, populating each one with a graphic, so effectively they are sprites. However, when I call [lineLayer setValue:[NSNumber numberWithFloat:0.5] forKeyPath:@"transform.scale"] it appears to 'tween' to…
jowie
  • 8,028
  • 8
  • 55
  • 94
1
vote
3 answers

Displaying CAEAGLLayer in a UIView or CALayer

Rather new to trying to get OpenGL ES working on the iPhone, but I've created a working demo from an OpenGL template and wanted to add it to another App which is a standard UIViewController App. After searching around it seems that I can't…
Rudiger
  • 6,749
  • 13
  • 51
  • 102
1
vote
1 answer

Crash [UITableViewCell initWithStyle:reuseIdentifier:]

I've got crash report for SIGSEGV. I think it's really not obvious because there are: No background UI manipulations. No external CALayer manipulations. UITableViewCell initialized programmatically, without using xib or storyboard. No KVO performs…
yariksmirnov
  • 489
  • 5
  • 10
1
vote
1 answer

Pixelated images in Retina displays

I am developing an app in which I use images at @1x in all the devices (they are photos and I can't get @2x versions of them). When a 300x225 px image is displayed in a Retina display at 300x225 points (i.e. 600x450 px) I would expect it to look as…
Aleix Pinardell
  • 271
  • 2
  • 8
1
vote
2 answers

CALayer causes memory leaks?

the following code makes my app slower as a snail (it causes a memory leak i think): CALayer *layer = [[CALayer layer] retain]; detailcell.layer.borderColor = [UIColor grayColor].CGColor; detailcell.layer.borderWidth =…
Jonathan
  • 139
  • 2
  • 11
1
vote
1 answer

CALayer transform doesn't apply if NSView isn't created yet at the moment

Environment: OS X 10.11 SDK, XCode 7.2, Cocoa; Context: Some complex transformation should be applied in the moment of views creation; When I'm trying to add NSView programmatically transform property is simply ignored if it's placed before…
1
vote
1 answer

make custom CALayer subclass automatically redraw itself after being added to a super layer

I am subclassing CALayer and doing custom drawing in drawInContext: method. The problem is I need to manually call setNeedsDisplay: after I add an instance of my subclass to a superlayer, something like: MyCustomLayer *instance = [MyCustomLayer…
Eddie Deng
  • 1,399
  • 1
  • 18
  • 30
1
vote
2 answers

How to draw a progress indicator on the background of a cell in iOS 9?

I would like to draw rectangles in the background of the cells of a table view, whose size will indicate the progression of subsequent tasks: The progression bar should take the whole height of the cell and its width will be programmatically set…
Benoît L.
  • 51
  • 6
1
vote
0 answers

How to rewrite on a CATextlayer?

I am using CATextLayer for my custom calendar design. I am using CAlayer to draw numbers for each month. But when i move to next month by pressing next button the dates are overlapping.I tried removing sublayers but no use. Please help me out.. But…
Daniella D'Cruz
  • 388
  • 1
  • 3
  • 15
1
vote
2 answers

how to redraw only one specific layer ? (IOS,SWIFT)

I have my UIView. I draw something in my UIView. I added a CALayer to my UIView. Now I would like my controller to only redraw my added CALayer. How do I do that ? In my actual Code it will redraw the main view. How can I redraw my subview…
mcfly soft
  • 11,289
  • 26
  • 98
  • 202