I was tinkering with UIScrollView a while back, just doing a simple demo to First , use a CATiledLayer as the layer class for my Starview. My current approach involves hosting a CATiledLayer (to fetch & render tiles in the current view frame) inside a UIScrollView (for event. The built-in zoom support in CATiledLayer integrates well (i.e., easily) with a UIScrollView, but it doesn’t quite work the way I’d like, and it’s not.

Author: Yozshuhn Shaktira
Country: Botswana
Language: English (Spanish)
Genre: Software
Published (Last): 3 October 2017
Pages: 114
PDF File Size: 13.87 Mb
ePub File Size: 11.59 Mb
ISBN: 825-3-66272-237-7
Downloads: 1159
Price: Free* [*Free Regsitration Required]
Uploader: Voodooran

My content view has a scaled of 0.

CATiledLayer (Part 2) | Things that were not immediately obvious to me

Second, I need to trigger a redraw of the image when the zoom level changes. This entry was posted in iPhone. Sign up using Email and Password. The big change to TiledView has to do with tile index calculation.

Recode the sizeContent method in zoomdemoViewController. Not all the tiles seem to load even though I can see requests are being made for thembut I’ll worry about that later.

Zooming a UIScrollView without a CATiledLayer

The big problem right catiledlayeg is that the simulator freezes up on subsequent calls to setCenter: The built-in zoom support in CATiledLayer integrates well i. For my sample graphic, I grabbed the Quartz sample code from another Apple sample, just to have something to draw. Any help will be greatly appreciated.


The scale factor is always 1.

The scrollview should just scroll horizontal, no zooming or vertical scrolling required. Oct 18, 4: And more generally, does this approach even make sense? Note that that code is still not great. That’s basically all there is to it, you can just draw as if the entire coordinate space is just there. Sep 29, Perhaps someone could give uiscrollvisw an outline, just some bulletpoints or pseudocode, how I should restructure the scrollview, uiview and the graph class to use tiling.

Begin by opening up zoomdemoViewController. Catiledayer to make the content offset change immediate, or your map won’t end up where you’d expect it to: If so, how should I continue?

Scott’s Space Wars emulator. Post was not catileedlayer – check your email addresses! So you should only need to slightly modify your Catoledlayer class so it can act as a CATiledLayer delegate. I was missing a couple of key points. By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.


You can run the demo, and see the zooming goodness. It was being drawn at the same pixel resolution used when zoomed out:. Panning outside of this region is an exercise left to the reader.

Sorry, your blog cannot share posts by email. You can download the demo at http: Posted on Sep 23, uiscroklview In my case it was 20 minutes well spent, boosting user experience by several orders of magnitude.

Also, there are some weird drawing issues with very large contentSize values. But I did not see any difference between your first code sample and the second one. Mac OS X I can get a map to show up geographically located where I expected it to be. I wanted to get the pinch scrolling to work so that I could pan around an image. Sep 23, 3: Things that were not immediately obvious to me.