Add PoolModel.isEmpty

This commit is contained in:
Davide De Rosa 2019-04-06 22:16:10 +02:00
parent 9d8e6c5056
commit 6f7b06b7c7
1 changed files with 6 additions and 2 deletions

View File

@ -33,6 +33,10 @@ private class PoolModel {
private(set) var sortedGroups: [PoolGroup] = [] private(set) var sortedGroups: [PoolGroup] = []
var isEmpty: Bool {
return sortedGroups.isEmpty
}
init(title: String) { init(title: String) {
self.title = title self.title = title
} }
@ -82,10 +86,10 @@ class ProviderPoolViewController: UIViewController {
paidModel.sort() paidModel.sort()
models = [] models = []
if !freeModel.sortedGroups.isEmpty { if !freeModel.isEmpty {
models.append(freeModel) models.append(freeModel)
} }
if !paidModel.sortedGroups.isEmpty { if !paidModel.isEmpty {
models.append(paidModel) models.append(paidModel)
} }
} }