Search code examples
apple-watchwkinterfaceimage

WKInterfaceImage and dynamic images on watchOS 2


If I create a UIImage and display it using a WKInterfaceImage it always displays the image as @1x instead of @2x resulting in a pixelated image. It worked fine with watchOS 1. How to fix this behavior with watchOS 2? The same code works fine on iOS with a UIImageView.


Solution

  • Here is the solution for creating the image from an NSData object on the Apple Watch at the correct screen scale.

    UIImage *image = [UIImage imageWithData:imageData scale:[[WKInterfaceDevice currentDevice] screenScale]];