Colour and Image asset references in IB documents cannot reside in other bundles

Originator:tobias.kress
Number:rdar://45984597 Date Originated:12-Nov-2018 11:16 AM
Status:Duplicate/7057746 Resolved:
Product:iOS + SDK Product Version:iOS 11
Classification:Security Reproducible:Always
 
Summary:
This is a duplicate of radar #35764499

When referencing an image or a named colour in an IB document (XIB or Storyboard), Xcode presents options for all images and colours in the workspace, even those that reside in different bundles. This makes the developer presume the IB document will reference the appropriate bundle for correct runtime resolution, but it does not.

At run time, such colour/image references won't be resolved. In case with colours, the fallback value will end up being used, resulting in any changes in the asset catalog not applying to IB documents that refer to its colours.

Steps to Reproduce:
1. Build the attached project (contains an app target with a Storyboard and a framework target with an asset catalog).
2. Observe the colour of the label (set in the Storyboard, references "Color" from the asset catalog) and the background colour (set in code, also references "Color" form the asset catalog).

Expected Results:
The colour of the label and the background colour are the same, as they reference the same colour asset, coming from the framework target.

Actual Results:
The colours won't match, unless you open manually the app's Storyboard and re-save it, allowing Xcode to resolve the colour reference and update the fallback.

Version/Build:
iOS 11.1
Xcode 9.2


Steps to Reproduce:
 

Expected Results:
 

Actual Results:
 

Version:
iOS 11

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!