Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 100107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:30:58+00:00 2026-05-11T00:30:58+00:00

There are methods to transfer a CGPoint from one UIView to another and from

  • 0

There are methods to transfer a CGPoint from one UIView to another and from one CALayer to another. I cannot find a way to change a CGPoint from a UIView’s coordinate system to a CALayer’s coordinate system.

Does a layer and it’s host view have the same coordinate system? Do I need to transform points between them?

Thanks, Corey

[EDIT]

Thanks for the answer! It is hard to find information on the differences/similarities between CA on the iPhone and Mac. I am surprised I couldn’t find this issue addressed directly in any Apple Documentation.

I was pursuing this answer to help with a bug I am troubleshooting, and this was so far my best guess, but I suppose I am barking up the wrong tree. If the coordinate systems are the same, then I have another issue…

The actual issue I am having can be found here on Stack Overflow: layer hit test only returning layer when bottom half of layer is touched

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:30:59+00:00Added an answer on May 11, 2026 at 12:30 am

    You can set the transform property of CALayers to the appropriate transform if you want to flip their coordinate system, but note that this will probably flip their drawing of the contents as well (I have not tested that, but it makes sense that this would be true). My assertion that the CALayer associated with a UIView shares the same coordinate system could in fact be entirely erroneous. It could also be that CALayers use the same coordinate system as UIViews (i.e. they’re never flipped vertically), but I thought they were since CoreGraphics uses a flipped coordinate system relative to UIKit.

    A simple way to test would be to add a screen-sized CALayer as the sublayer of a view’s layer, then add another small CALayer as a sublayer of that. You could set it to show up at (0, 0, 320, 100) and see if it shows up on the top or the bottom of the iPhone’s screen. This will tell you in which direction the Y axis goes for CoreAnimation.

    - (void)viewDidLoad {   [super viewDidLoad];   CALayer *rootLayer = [CALayer layer];   rootLayer.frame = self.view.layer.bounds;   CALayer *smallLayer = [CALayer layer];   smallLayer.frame = CGRectMake(0, 0, rootLayer.bounds.size.width, 50);   smallLayer.backgroundColor = [UIColor blueColor].CGColor;   [rootLayer addSublayer:smallLayer];   [self.view.layer addSublayer:rootLayer]; } 

    I just performed this test myself, and it appears CALayers actually use the same coordinate system as UIViews, so my assertion that CALayer’s flip the Y axis is definitely wrong. However, if you do drawing with CoreGraphics directly, be aware that CoreGraphics does use a flipped Y axis (though when drawing in a UIView subclass or, I assume, a CALayer delegate, the CoreGraphics context has already been flipped to match the UIView’s (or CALayer’s) coordinate system).

    So the short answer, if you made it this far, is the coordinate system for CALayer should match the coordinate system for its corresponding UIView.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to configure IIS 7 to transfer a request to another
In Excel, there are methods to access data from external data sources. Excel comes
Is there a good method on how to transfer a file from say... a
Are there methods for encoding and decoding XML in .NET? I can't seem to
Are there methods to obfuscate during/after compile that are automated?
Are there any methods/systems that you have in place to incentivize your development team
In Java there are methods to go about scanning the classpath/all classes/within a package
In some sample codes there are methods and classes declared WITHIN other methods and/or
First, I know there are methods off of the generic List<> class already in
Specifically in JAX-RS (I'm not sure that is relevant) there are methods that allow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.