Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions TZStackView/TZStackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down