3

What is the correct way to find out which apple watch is it programmatically whether it's 38mm or 42mm? How can I make a struct object for the same to access it like below:

if watch.size == 38 { 
} else { 
}
Parth Adroja
  • 13,198
  • 5
  • 37
  • 71
  • possible duplicate of http://stackoverflow.com/questions/29528792/how-to-tell-if-current-running-apple-watch-size-dimension-is-38mm-or-42mm – ridvankucuk Mar 20 '17 at 07:55

1 Answers1

3

You can check Apple Watch size in below following way:-

public struct watch {

     public static var screenWidth: CGFloat {
          return WKInterfaceDevice.current().screenBounds.width
     }

     public static var is38: Bool {
          return screenWidth == 136
     }

     public static var is42: Bool {
          return screenWidth == 156
     }
}
Sagar Thummar
  • 2,034
  • 15
  • 21