UISwitch's intrinsic content size is incorrect

Originator:jykuang999
Number:rdar://31777116 Date Originated:23-Apr-2017 05:40 PM
Status:Open Resolved:No
Product:UIKit Product Version:10.3.1
Classification:UI/Usability Reproducible:Always
 
Summary:
The UISwitch's intrinsic content size (UISwitch.intrinsicContentSize) is (49.0, 31.0), but the actual size is (51.0, 31.0).
This makes some auto layout issue, for example, UISwitch and views with same trailing space to superview are not trailing alignment (as shown in attached screenshots).

Expected Results:
UISwitch.intrinsicContentSize == (51.0, 31.0)

Actual Results:
UISwitch.intrinsicContentSize == (49.0, 31.0)

Notes:
Workaround: manually set UISwitch's width constraint to 51.0.

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!