How do I stop an enumeration here if I am doing the following? I think the docs said that to set stop = TRUE. but when I do that inside the block it says that it isn't unassignable.
[self.visibleViewControllers_ enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if (CGRectIntersectsRect(visibleRect, viewRect)) {
//break here
}
}];
Set *stop
to YES
[self.visibleViewControllers_ enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if (CGRectIntersectsRect(visibleRect, viewRect)) {
*stop =YES;
return;
}
}];
For SWIFT 2:
Dict.enumerateKeysAndObjectsUsingBlock { (key, value, stop) -> Void in
if(//Something){
//Do Something
}
else {
//To Stop
stop.memory = true
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With