Reputation: 895
I have an action from my UIButton that calls a function. Eg:
-(void)function:(id)sender{
// execute some code here
}
Is this possible?
Upvotes: 0
Views: 57
Reputation: 10533
Basically you can work with an ivar to indicate that function has not finished executing. Something like:
BOOL isFinished;
-(void)function:(id)sender{
if(!isFinished) {
// stop your process
// start it again
// and indicate that it's running (isFinished is still false)
}
else {
isFinished = NO;
// just start your process
}
}
When your function/process has finished, set isFinished = YES;
from there.
Upvotes: 3