IBInspectable set called before view's layout has been done
| Originator: | keithbsmiley | ||
| Number: | rdar://28199747 | Date Originated: | 07-Sep-2016 18:51 |
| Status: | Duplicate of 28221021 (open) | Resolved: | |
| Product: | iOS SDK | Product Version: | iOS 10 GM |
| Classification: | Other Bug | Reproducible: | Always |
Summary: Beginning with the iOS 10 SDK IBInspectable properties set from interface builder are set before the view has been laid out. Steps to Reproduce: 1. Create an extension on UIView 2. In it create an IBInspectable that references `self.bounds` in the setter 3. Set a breakpoint in the setter 4. Create a view in the app that sets this inspectable property 5. Give the view constraints for size and position 6. Run the app 7. When it hits the breakpoint, run `po self.bounds` Expected Results: The view should have been laid out already, so self.bounds should reflect the constrained size. Actual Results: The view's bounds are 1000 by 1000 Version: iOS 10 GM Notes: See the sample project for an example. Note the logs.
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!