lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
246 stars 17 forks source link

35029997: -UIViewShowAlignmentRects YES Crashes with UIVisualEffectView #18690

Open openradar-mirror opened 6 years ago

openradar-mirror commented 6 years ago

Description

Area: UIKit

Summary: Adding the launch argument -UIViewShowAlignmentRects YES to debug alignment rectangles causes a crash if there is a UIViewEffectView in the view hierarchy. This happens for example with a plain UIViewController embedded in a navigation controller.

Steps to Reproduce:

  1. Create a new Xcode project using the single view app template.
  2. Modify the storyboard to embed the view controller in a navigation controller.
  3. Edit the scheme to add and enable the following launch argument to the run action: -UIViewShowAlignmentRects YES
  4. Build and run on a simulator

Expected Results:

The alignment rectangles of the views are displayed in yellow.

Actual Results:

Crashes with following console message:

2017-10-17 16:46:24.425431+0100 Alignment[24633:2704672] [LayoutConstraints] UIViewShowAlignmentRects is ON 2017-10-17 16:46:24.505213+0100 Alignment[24633:2704672] Assertion failure in -[UIVisualEffectView _addSubview:positioned:relativeTo:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3698.16.15/UIVisualEffectView.m:1464 2017-10-17 16:46:24.512331+0100 Alignment[24633:2704672] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: ' > has been added as a subview to >. Do not add subviews directly to the visual effect view itself, instead add them to the -contentView.'

Version/Build: iOS 11.0.1 (15A8401) Xcode Version 9.0.1 (9A1004)

- Product Version: 9.0.1 Created: 2017-10-17T16:03:24.745830 Originated: 2017-10-17T00:00:00 Open Radar Link: http://www.openradar.me/35029997

ilanl commented 5 years ago

Same happens on XCode 10.0 beta 6