My application is a document based application I present the saved content using an UIViewController subclass EditViewsController with the help of my customized UIDocument object.
EditViewsController will look like below
Tapping the close Button on the left top corner will fire the below method
-(IBAction)closeForm:(id)sender
{
// _formDocument is my UIdocument subclass Object
[_formDocument closeWithCompletionHandler:^(BOOL completion){
[self dismissViewControllerAnimated:YES completion:nil];
}];
}
My problem is that while calling the method closeWithCompletionHandler
my application freezes for a while before closing.
My question is that is it right to dismiss the viewcontroller without closing the document (simply call dismissViewControllerAnimated:
inside the firing method) or I have to run that method in background thread to get rid of
freezing?