Questions tagged [catiledlayer]

A tiled layer is a Core Animation layer which divides its drawing area into equal, rectangular areas which are drawn separately. It can be used to display very large contents in a space-saving way in a scrollview. It also allows different levels of detail depending on the current zoom level.

CATiledLayer is a subclass of providing a way to asynchronously provide tiles of the layer's content, potentially cached at multiple levels of detail.

As more data is required by the renderer, the layer's drawLayer:inContext: method is called on one or more background threads to supply the drawing operations to fill in one tile of data. The clip bounds and current transformation matrix of the drawing context can be used to determine the bounds and resolution of the tile being requested.

163 questions
7
votes
2 answers

CATiledLayer drawLayer:inContext always being called on Main thread - MacOS El Capitan

I'm using a CATiledLayer backed NSView (Mac not iOS) and according to Apple docs https://developer.apple.com/reference/quartzcore/catiledlayer I expect this to be called asynchronously, on multiple threads to aid performance, however it only appears…
Herwr
  • 494
  • 2
  • 7
6
votes
2 answers

Deallocate memory used by CGContextDrawPDFPage

When I analyze my app with Instruments, I found out that data allocated by CGContextDrawPDFPage is not released immediately. Since my program receives a lot of 'memory warnings' I would like to release as much memory as possible but I don't know how…
6
votes
1 answer

How to draw parts of a UIView as it becomes visible inside UICollectionView?

On Android I have item views with potentially large widths on a horizontal scrolling list. The view loads and draws chunks "images" as parts of the view become visible on the list. This is an optimization to avoid drawing all images at once as it…
Jona
  • 13,325
  • 15
  • 86
  • 129
6
votes
1 answer

Drawing in CATiledLayer with CoreGraphics CGContextDrawImage

I would like to use a CATiledLayer in iPhone OS 3.1.3 and to do so all drawing in -(void)drawLayer:(CALayer *)layer inContext:(CGContext)context has to be done with coregraphics only. Now I run into the problems of the flipped coordinate system on…
GorillaPatch
  • 5,007
  • 1
  • 39
  • 56
6
votes
3 answers

How do I remove those rotation artefacts from my CATiledLayer?

I have a CATiledLayer into which I render content in the following method - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx I used the QuartzDemo code to draw a pattern. This works very well until I apply a rotation transform to the…
Felix Lamouroux
  • 7,414
  • 29
  • 46
5
votes
3 answers

taking image snapshot of CATiledLayer-backed view in UIScrollView

I've got a custom map view which is made of a UIScrollView. The scroll view's subview is backed by a CATiledLayer. Everything works great here. Panning & zooming loads up new map tiles and everything performs well. What I want to do is capture…
incanus
  • 5,100
  • 1
  • 13
  • 20
5
votes
1 answer

UIScrollView and CATiledLayer from the ground up

my situation: I created an UIScrollView with an UIView inside which calls a Graph class which draws a nice graph on a context. Now I discovered that the phone wouldn't render the UIView if it's width is larger than 8192 pixels. In fact, according to…
marimba
  • 3,116
  • 5
  • 26
  • 29
5
votes
3 answers

Efficient custom tiled maps with custom zoom levels and zoom factors

I have to implement a very custom tiled map layer/view on iOS5/6 (iPhone), which loads tiles as Images and/or data (JSON) from a server. It is like google maps, but at certain points very specific, so I cannot easily use a solution such as: …
Fab1n
  • 2,103
  • 18
  • 32
5
votes
4 answers

CATiledLayer being removed and refreshed while zoomed in iPad 3rd gen

I'm experiencing a redraw problem on a CATiledLayer when the parent UIScrollView is zoomed in. I'm rendering a PDF page in a CATiledLayer backed UIView. It has another UIImageView behind it, which contains a low-res image of the page that the…
Altealice
  • 3,572
  • 3
  • 21
  • 41
4
votes
1 answer

How does CATiledLayer know when to provide a new tile?

Because of various reasons, I am considering to make my own implementation of CATiledLayer. I have done some investigation, but I don't seem to be able to figure out how CATiledLayer knows which tile to provide. For example, when you scroll the…
fishinear
  • 6,101
  • 3
  • 36
  • 84
4
votes
1 answer

Zooming and Scrolling large images in UIScrollView

I've been stuck at this for quite some time. I've looked at many other answers and also at Apple's examples. What I want to know is how I can go about loading large images in UIScrollView, and be able to page through them and zoom in to them, like…
codeBearer
  • 5,114
  • 4
  • 25
  • 29
4
votes
2 answers

Reading text and images from a pdf document in iOS

I'm displaying locally stored pdf in my iPad application. Here's the code: NSString *path = [[NSBundle mainBundle] pathForResource:@"About Downloads" ofType:@"pdf"]; NSURL *targetURL = [NSURL fileURLWithPath:path]; NSURLRequest *request =…
Mustafa
  • 20,504
  • 42
  • 146
  • 209
4
votes
1 answer

Not all tiles redrawn after CATiledLayer -setNeedsDisplay

My view has a CATiledLayer. The view controller has custom zooming behavior, so on -scrollViewDidEndZooming every tile needs to be redrawn. But, even though -setNeedsDisplay is being called on the layer after every zoom, not all tiles are being…
jlstrecker
  • 4,953
  • 3
  • 46
  • 60
4
votes
4 answers

CATiledLayer drawInContext called after associated view is gone

I ran into an interesting iOS problem today involving a CATiledLayer. This only happend on the device - not in the simulator. My view draws in its CALayer via the drawLayer: inContext: delegate callback. This layer has a CATiledLayer-derived…
TomSwift
  • 39,369
  • 12
  • 121
  • 149
4
votes
1 answer

CATiledLayer shows previous tiles

When invalidating a view backed by a CATiledLayer, a previous tile remains "stuck" and isn't correctly invalidated. This seems to happen when the view is invalidated (on the main thread), while at the same time, the tile render threads are still…
Tom Lokhorst
  • 13,658
  • 5
  • 55
  • 71
1
2
3
10 11