Search code examples
ioswatchkitapple-watchwatchos-4clockkit

WatchKit complications: watch complication set has an unassigned item


I'm working on a watchOS app with a modular large face complication. The Assets.xcassets file in the WatchKit Extension includes a Complication folder with one image set each for Circular, Extra Large, Modular and Utilitarian, but in my case I have multiple possible assets for the Modular type, which I will choose from programmatically (called Bottlefed, Breastfed and Pump). I was able to rename the Modular image set to Bottlefed, and then added the other two image sets to the Complication folder and populated them with images:

Assets.xcassets complication folder with multiple assets

But doing this ends up showing the following warning in Xcode:

enter image description here

I can't find any documentation or examples of people using multiple images for assets to show me if I'm doing this the intended way or not.

Note that my approach does actually work, as far as adding multiple assets to the asset catalog and selecting from them programmatically. But the warning in Xcode is irritating, and makes me think I'm not doing this the correct way. Any thoughts?


Solution

  • In the end, turns out the easiest thing to do is to simply not use the Complication folder in the WatchKit Extension's asset catalog. Just putting the assets in the top level of the asset catalog and ignoring the Complication folder still loads the images into the complication, and avoids the Xcode warnings. (Shoutout to the maker of CARROT weather for helping me out with this one!)