21

My Apple Watch app images showing properly on Apple Watch Simulator,Like on menu modules menu images showing properly on simulator.
I uploaded my application on iTunes store , Apple Reviewed app & failed it by saying menu images are not showing on Apple Watch.

Any Idea why menu images are not showing on actual Apple Watch while it is showing on Apple Watch Simulator .
I set menu images directly from storyboard . Should i set Images from programmatically ? please help me.

Anupam Mishra
  • 3,408
  • 5
  • 35
  • 63

6 Answers6

17

Thanks for quick help ! everyone is right we should prefer to use Asset Catalog , I would like to share step by step solution of this issue that I got from apple developer forum given by behrens---

  1. If the images are static resources that you already have, they should reside in the WatchKit app bundle. If they're dynamic, you can set them from the WatchKit extension at runtime.

  2. They must be @2x named, yes.

  3. It's your best bet to store them in an asset catalog. Not sure reasoning on why you wouldn't.

  4. If you expand the attributes inspector, you can narrow the support for the image in the asset catalog to Apple Watch only. If you only have one version, drop it in the 2x bucket. If you have device-size specific images, drop them accordingly and I would add the 38mm sized image to the 2x bucket for a fallback.

For more details please visit the link - link

Anupam Mishra
  • 3,408
  • 5
  • 35
  • 63
  • not worked for me !!! :`http://stackoverflow.com/questions/31168429/watchkit-image-not-showing-on-real-device` – iOS.Lover Jul 01 '15 at 19:14
  • Jeez!!! Hey Apple, how about showing a warning, or at least stick your tongue out, about this? – Josh Feb 16 '16 at 13:02
9

Your images have to be in an Asset Catalog to display on the device for Apple Watch

https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/Recipe.html

JSA986
  • 5,870
  • 9
  • 45
  • 91
  • While image catalog are the easiest route - I still don't understand why people are reluctant to use them - that's not strictly true. My approved app uses a couple non-catalog images for specific reasons. – bgilham Apr 20 '15 at 10:28
  • Yoru Approved Apple Watch App uses non-catalog images? – JSA986 Apr 20 '15 at 10:38
7

We have two Assets.xcassets file. One of them is for Interface.storyboard and bundle Watch app. The second of them is the bundle Extension. If you setImage from code, You should have this image in the bundle Extension.

folder tree

Floern
  • 33,559
  • 24
  • 104
  • 119
Marlon Ruiz
  • 1,774
  • 16
  • 14
1

When You use Images in Code. There’s one small problem with using the UIImage(named:) initializer. It only looks in the local bundle. We’ll need to load these images into the Images.xcassets for the extension. The ones in the WatchKit App folder we made last time wont reach here.

    import WatchKit
    import Foundation

    class InterfaceController: WKInterfaceController {

    enum GrossMarket: Int{
        case egg = 1
        case apple = 2
        case orange = 3
    }

        //preload images
        let egg = UIImage(named: "egg")
        let apple = UIImage(named: "apple")
        let orange = UIImage(named: "orange")
}

    func updateDisplay(activity:Activites){
        switch activity{
        case .egg:
            statusImage.setImage(egg)
        case .apple:
            statusImage.setImage(apple)
        case .orange:
            statusImage.setImage(orange)
        default:
            statusImage.setImage(orange)

        }
    }
Durul Dalkanat
  • 7,266
  • 4
  • 35
  • 36
0

Are your images stored in your WatchKit app's bundle? Unfortunately, interface builder allows you to select an image from any bundle, but only images stored in your WatchKit app's bundle - or transmitted by your extension - will be visible when run on hardware.

bgilham
  • 5,909
  • 1
  • 24
  • 39
  • 1
    Hi bgilham , my images are stored in WatchKit app's bundle & Interface builder showing it properly . Should I set the images programmatically like - setImageNamed: or setBackgroundImageNamed: methods as said by apple here - https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/Images.html – Anupam Mishra Apr 20 '15 at 10:24
0

Check the Resolution of the picture. I try 2 Picture and the lowest resolution display at least in the Apple Watch Emulation

Josean Maya
  • 161
  • 2