4
votes

I just started with my first Mac App, but I realised that the coordinate-system is "flipped" (x = 0, y = 0 is in the lower left corner). I'm having a lot of trouble with UI programming because I'm used to the iOS coordinate-system.

My Question now is: Can I flip the coordinate-system of my App/Window forever so that I don't have to flip all my subviews also.

Thats my App: My apps window contains a NSScrollView with posts from recent to old. When I add my first post I want it to be right at the top of the scrollView.

I hope someone had the same problem and can help me out. Thanks

2

2 Answers

6
votes

You can do a override of the method called - (BOOL)isFlipped in your NSView classes. Make it to return YES to get the iOS like coordinate system(AKA flipped). By default it returns NO, just like what you see now. Do so will also solve your second problem because the coordinates are flipped.

1
votes

you can change it programatically as TonyD has suggested or via interface builder in size inspector using origin pane

origin