In my app, I present the user with an MFMessageViewController, and after 10 seconds, I auto-dismiss it by calling
[self.presentedViewController performSelector:@selector(dismissModalViewControllerAnimated:)
withObject:[NSNumber numberWithBool:YES] afterDelay:10];
The problem is, if the user has begun using the MFM (i.e. adding a recipient by either typing or hitting the plus sign or editing the body), I have no way to cancel this call. I know that I could call
[NSObject cancelPreviousPerformRequestsWithTarget:self.presentedViewController
selector:@selector(dismissModalViewControllerAnimated:) object:[NSNumber
numberWithBool:YES]];
but I have no way of knowing when the user has started editing the MFM in the ways described above. Is there a solution to this?
I suggest that you leave the dismissal of the MFMessageViewController
to the user. The user has invoked it & he would be the best judge when to dismiss it. In this case auto-dismiss I think is not safe & might piss off the user in some cases.
Its just not intuitive. Why would you want to dismiss in 10 secs? Just let it be.
Everything should be made as simple as possible, but no simpler — Albert Einstein