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
  • 0 Views
  • 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

Ask A Question

Stats

  • Questions 68k
  • Answers 68k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Yes, your code has a few issues. In C, don't… May 11, 2026 at 12:19 pm
  • added an answer That MyProject.pbxindex is just there for CodeSense. :) Close Xcode… May 11, 2026 at 12:19 pm
  • added an answer AFAIK, There is only an SDK (via COM) for Windows.… May 11, 2026 at 12:19 pm

Related Questions

What methods to use a database from Clojure are there? I know from Clojure
I got the code of a former employee. There are many calls to methods
As part of a client support tool, I'm wanting to provide some functionality to
Do you use a formal event to get people talking in your IT department?

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.