13

I would like to understand how we can know whether the apple watch is 38mm or 42mm so that I can programmatically set the images for UI elements.

1 Answer 1

32

I figured it out in WKInterfaceDevice class

NSLog(@"%@", CGRectCreateDictionaryRepresentation([WKInterfaceDevice currentDevice].screenBounds));

42mm { Height = 195; Width = 156; X = 0; Y = 0; }

38mm { Height = 170; Width = 136; X = 0; Y = 0; }

3
  • 5
    In Swift, you use WKInterfaceDevice.currentDevice().screenBounds for the same effect.
    – Odinodin
    Feb 13, 2015 at 21:08
  • Does this size includes the status bar? For an image (for example) that fill the screen, we must subtract the height of the status bar?
    – Markus
    Oct 2, 2016 at 0:01
  • @Markus: That is the number of pixels on the physical screen, so it includes status bars and everything else. Oct 31, 2018 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.