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 3782598
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:06:20+00:00 2026-05-19T11:06:20+00:00

The y coordinate is annoying, because 0 is the bottom on the mac and

  • 0

The y coordinate is annoying, because 0 is the bottom on the mac and the top on iOS. But I don’t want to flip everything . . . images, for example, are the same way up on both platforms.

What is the most efficient way to have everything work on both platforms?

  • 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. Editorial Team
    Editorial Team
    2026-05-19T11:06:21+00:00Added an answer on May 19, 2026 at 11:06 am

    The way I’ve approached this, and the way that is used in the Core Plot framework, is to base all of my layer coordinates on the Quartz coordinate system (where the origin is at the bottom left). On iOS, I then create a custom layer-hosting view that un-inverts the coordinate system of its hosted layer. CALayers still have the same coordinate system on iOS, it’s just that CALayers that back UIViews have their coordinate system inverted.

    To do this, I use code like the following in the initialization of the UIView:

    self.layer.sublayerTransform = CATransform3DMakeScale(1.0, -1.0, 1.0);
    

    and then I create one main hosted layer as a sublayer of that UIView’s backing layer, and add all of my custom layers to that hosted layer.

    Again, you can look at the code for the Core Plot framework to see how this works in practice, because that’s how this framework handles layer-based drawing across the two platforms with almost all of the same code.

    There are just a few conditions you have be careful of on iOS, such as the NSString drawing methods which need to be flipped to account for the Quartz coordinate space.

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

Sidebar

Related Questions

I have a coordinate. I want to find the top n (n being a
i want to use the best Coordinate. but one thing is confusing me here
I have a coordinate from Core Location and want to calculate the co-ordinate given
JTS.orthodromicDistance(new Coordinate(0,0), new Coordinate(180,0), DefaultGeographicCRS.WGS84) * 2 is equal to 40075016 but must be
On a coordinate plane, what is the equation to flip the image upside down?
I'm encountering a very annoying error using Core Data on Mac OS X 10.5.
i try get curent coordinate and addres with NETWORK_PROVIDER in trhead, but when i
Please help me i want to get coordinate of droppin and also want to
Similar to: Setting graph figure size But, I just want to set the width
UIKit has a coordinate system with an origin at top left. Core Graphics has

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.