Skip to content

Commit 76d074d

Browse files
fix for case when view controllers are empty
1 parent 3665d14 commit 76d074d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

RAMAnimatedTabBarController/RAMAnimatedTabBarController.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,12 @@ open class RAMAnimatedTabBarController: UITabBarController {
132132

133133
// MARK: create methods
134134
private func initializeContainers() {
135-
guard let items = tabBar.items, items.count <= 5 else {
136-
fatalError("More button not supported")
137-
}
138-
139135
containers.forEach { $0.removeFromSuperview() }
140136
containers.removeAll()
141137

138+
guard let items = tabBar.items else { return }
139+
guard items.count <= 5 else { fatalError("More button not supported") }
140+
142141
for index in 0 ..< items.count {
143142
let viewContainer = UIView()
144143
viewContainer.isExclusiveTouch = true

0 commit comments

Comments
 (0)