minor fix in demo app

This commit is contained in:
John Estropia
2019-02-28 13:13:01 +09:00
parent a1407e4121
commit ebbde8b7b6

View File

@@ -313,6 +313,7 @@ class ListObserverDemoViewController: UITableViewController, ListSectionObserver
@IBAction private dynamic func shuffleBarButtonItemTouched(_ sender: AnyObject?) { @IBAction private dynamic func shuffleBarButtonItemTouched(_ sender: AnyObject?) {
self.setTable(enabled: false)
ColorsDemo.stack.perform( ColorsDemo.stack.perform(
asynchronous: { (transaction) in asynchronous: { (transaction) in
@@ -322,12 +323,16 @@ class ListObserverDemoViewController: UITableViewController, ListSectionObserver
palette.colorName .= nil palette.colorName .= nil
} }
}, },
completion: { _ in } completion: { _ in
self.setTable(enabled: true)
}
) )
} }
private func setTable(enabled: Bool) { private func setTable(enabled: Bool) {
tableView.isUserInteractionEnabled = enabled
UIView.animate( UIView.animate(
withDuration: 0.2, withDuration: 0.2,
delay: 0, delay: 0,
@@ -337,7 +342,6 @@ class ListObserverDemoViewController: UITableViewController, ListSectionObserver
if let tableView = self.tableView { if let tableView = self.tableView {
tableView.alpha = enabled ? 1.0 : 0.5 tableView.alpha = enabled ? 1.0 : 0.5
tableView.isUserInteractionEnabled = enabled
} }
}, },
completion: nil completion: nil