From 2db70d23d60b728b7a9ff68b80ac5aaaf8e5ad79 Mon Sep 17 00:00:00 2001 From: Romain Vincens Date: Thu, 14 Apr 2016 16:47:50 +0200 Subject: [PATCH] =?UTF-8?q?Fixed=20divide=20by=200=20=C2=ABNaN=C2=BB=20cra?= =?UTF-8?q?sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TZStackView/TZStackView.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TZStackView/TZStackView.swift b/TZStackView/TZStackView.swift index c2549a2..6af634d 100755 --- a/TZStackView/TZStackView.swift +++ b/TZStackView/TZStackView.swift @@ -402,6 +402,11 @@ public class TZStackView: UIView { } totalSize += (CGFloat(totalCount - 1) * spacing) + // Prevent รท0 crash when all arranged subviews have their total size equal to 0 + if totalSize == 0 { + totalSize = 1 + } + var priority: Float = 1000 let countDownPriority = (views.filter({!self.isHidden($0)}).count > 1) for arrangedSubview in views {