ShareKit
ShareKit copied to clipboard
Mail does not dismiss if user uses + button
see: http://www.ideashower.com/support/read-it-later/ril-pro-220-email-screen-does-not-disaper/
Hello, I've faced the same problem. Here is a quick fix :
in SHK.m add this condition to the - (void)viewWasDismissed method :
- (void) viewWasDismissed { if (self.isDismissingView) { //.....The rest of the body } }
had the same problem here too, thanks for posting the fix!!
Same to me. Jakil fix works! But there's no feedback to the user, just the sent sound after a few seconds.
I have been experiencing the same problem as noted in the URL posted by ideashower (who I believe is Nate). When a user clicks 'Send' or 'Save Draft' or 'Delete Draft' the email window does not close.
I tried the fix that Jakil found, but it did not resolve the problem. Here is the code with Jakil's fix, is this how the fix was to be implemented?
- (void)viewWasDismissed
{
if (self.isDismissingView) {
self.isDismissingView = NO;
if (currentView != nil)
currentView = nil;
if (pendingView)
{
// This is an ugly way to do it, but it works.
// There seems to be an issue chaining modal views otherwise
// See: http://github.com/ideashower/ShareKit/issues#issue/24
[self performSelector:@selector(showPendingView) withObject:nil afterDelay:0.02];
return;
}
}
}
After some more searching, turns out someone else had this problem and found a solution that resolved my problem. The resolution is described by jeanfabre in this issue thread https://github.com/ideashower/ShareKit/issues/41
Simply add the following line of code:
[controller dismissModalViewControllerAnimated:YES];
To the end of the method - (void)mailComposeController:didFinishWithResult:error:
in SHKMail.m
It should look like this when it's all said and done:
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
[[SHK currentHelper] hideCurrentViewControllerAnimated:YES];
switch (result)
{
case MFMailComposeResultSent:
[self sendDidFinish];
break;
case MFMailComposeResultSaved:
[self sendDidFinish];
break;
case MFMailComposeResultCancelled:
[self sendDidCancel];
break;
case MFMailComposeResultFailed:
[self sendDidFailWithError:nil];
break;
}
[controller dismissModalViewControllerAnimated:YES];
}