Xcode - IBDesignables don't read "Render As" flag from xcassets
| Originator: | igeek1 | ||
| Number: | rdar://18962542 | Date Originated: | 12-Nov-2014 06:41 PM |
| Status: | Duplicate of 18764959 | Resolved: | 17-Nov-2014 06:59 PM |
| Product: | Developer Tools | Product Version: | Xcode 6.1 (6A1052c) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: If you assign an image to a subclass of a UIImageView in a xib or storyboard, and your class depends on the renderingMode being set to "Always Template" from an xcasset catalog, it will not be correct when using it in IB, but it will at run time. Steps to Reproduce: 1. Open the attached sample project. Notice the following: a) There is an image in images.xcassets. b) The image's "Render As" mode is set to "Always Template". c) There is a class, TestImageView, which subclasses UIImageView. It is a simplified example of a class I made for a project. Its purpose is to set its own tint color to some custom color at run time. 2. Open Main.storyboard. Notice that the image, which says "I SHOULD BE ORANGE", is black. 3. Run the app and observe that the text is orange on the device or simulator. 4. Open TestImageView.m and uncomment the lines 24–26 (the #if TARGET_INTERFACE_BUILDER section). 5. Refresh the views in IB (they don't seem to update automatically when you uncomment those lines; another bug?). 6. You will see that the image now correctly renders in orange. Expected Results: When an image's rendering mode is specified as Always Template in an asset catalog, that information should be available at design time to code running inside an IB_DESIGNABLE class. Actual Results: The image appears to be getting reset to the default rendering mode in IB, but the rendering mode is correct at run time. Version: Xcode 6.1 (6A1052c) Notes: Configuration: Occurs in IB, not in simulator or on device Attachments: sample project: http://cl.ly/YV6C
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!