Search code examples
iphonecoordinatesquartz-2d

what's the iphone bottom right Coordinates?


start point of the line is (0,0). What's the bottom right Coordinates?

Thanks!


enter image description here


Solution

  • Dimensions of the device screen:

    [UIScreen mainScreen].bounds
    

    Your apps window:

    [[[UIApplication sharedApplication].delegate] window].bounds
    

    Any view controller:

    myViewController.view.bounds
    

    All of these return a CGRect. The bottom right is:

    CGPointMake(CGRectGetMaxX(myRect), CGRectGetMaxY(myRect));