Fix crash on iPhone when tapping ALL ON or ALL OFF
This commit is contained in:
@@ -211,7 +211,7 @@ class SwitchesViewController: UIViewController,
|
|||||||
var currentDelay: NSTimeInterval = 0.0
|
var currentDelay: NSTimeInterval = 0.0
|
||||||
|
|
||||||
for i in ActionCell.count ..< collectionView.numberOfItemsInSection(indexPath.section) {
|
for i in ActionCell.count ..< collectionView.numberOfItemsInSection(indexPath.section) {
|
||||||
let cell = collectionView.cellForItemAtIndexPath(NSIndexPath(forItem: i, inSection: indexPath.section)) as! WemoDeviceCellView
|
if let cell = collectionView.cellForItemAtIndexPath(NSIndexPath(forItem: i, inSection: indexPath.section)) as? WemoDeviceCellView {
|
||||||
let animOptions = UIViewAnimationOptions([.AllowUserInteraction])
|
let animOptions = UIViewAnimationOptions([.AllowUserInteraction])
|
||||||
|
|
||||||
UIView.animateWithDuration(0.3, delay: currentDelay, options: animOptions, animations: {
|
UIView.animateWithDuration(0.3, delay: currentDelay, options: animOptions, animations: {
|
||||||
@@ -220,6 +220,7 @@ class SwitchesViewController: UIViewController,
|
|||||||
|
|
||||||
currentDelay += 0.05
|
currentDelay += 0.05
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for device in self.devices {
|
for device in self.devices {
|
||||||
device.state = (tappedActionCell == .AllOn ? .On : .Off)
|
device.state = (tappedActionCell == .AllOn ? .On : .Off)
|
||||||
|
|||||||
Reference in New Issue
Block a user