UIApperance and various crashes

后端 未结 3 1889
庸人自扰
庸人自扰 2021-01-07 01:09

I\'m getting so frustrated while customizing my app. I\'ve already created and styled almost the whole app, including Navigation bar, toolbar, tabBar etc, but everytime a MF

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-07 01:28

    You need to add necessary frameworks for twitter, facebook.
    For email do following :

    Add MessageUI.framework to your project

    In your .h file

    #import 
    
    @interface CustomController : UIViewController
    

    In your .m file

    - (IBAction)actionEmail:(id)sender
    {
    NSLog(@"actionEmail Called");
    
    MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
    mc.mailComposeDelegate = self;
    [self presentViewController:mc animated:YES completion:NULL];
    
    
    }
    
    - (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
    {
    switch (result)
    {
        case MFMailComposeResultCancelled:
            NSLog(@"Mail cancelled");
            break;
        case MFMailComposeResultSaved:
            NSLog(@"Mail saved");
            break;
        case MFMailComposeResultSent:
            NSLog(@"Mail sent");
            break;
        case MFMailComposeResultFailed:
            NSLog(@"Mail sent failure: %@", [error localizedDescription]);
            break;
        default:
            break;
    }
    
    // Close the Mail Interface
    [self dismissViewControllerAnimated:YES completion:NULL];
    }
    

提交回复
热议问题