From 9244d52a4ab294789642f56e3568dfd0ab57efaf Mon Sep 17 00:00:00 2001 From: Drew Olbrich Date: Tue, 5 Feb 2019 08:32:26 -0800 Subject: [PATCH] Log content view size warning only for debug builds --- Source/ScrollingContentViewManager.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/ScrollingContentViewManager.swift b/Source/ScrollingContentViewManager.swift index 102e7c6..8b8162c 100644 --- a/Source/ScrollingContentViewManager.swift +++ b/Source/ScrollingContentViewManager.swift @@ -231,6 +231,7 @@ public class ScrollingContentViewManager: KeyboardObservering, ScrollViewBounceC return } + #if DEBUG let contentViewSystemLayoutSize = contentView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) let contentViewIntrinsicContentSize = contentView.intrinsicContentSize let widthIsDefined = contentViewSystemLayoutSize.width > 0 || contentViewIntrinsicContentSize.width != UIView.noIntrinsicMetric @@ -241,6 +242,7 @@ public class ScrollingContentViewManager: KeyboardObservering, ScrollViewBounceC if !widthIsDefined && !heightIsDefined { NSLog("Warning: The content view's size is undefined. You must have an unbroken chain of constraints and views stretching across at least one axis of the content view or the content view's intrinsic content size must be defined.") } + #endif if contentView.superview == nil { addScrollViewToHostViewControllerRootView()