Question

I have this container view that opens, and inside it, i want to add the email composer, when i have some title and more stuff in this UIView window.

But it seems that i can't add the composer , but only to view controller .

Is there a way to add it into my UIView ? i couldn't find that implementation on the net .

 MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
    mailController.mailComposeDelegate = self;
    [mailController setSubject:@"Feedback"];
    NSString *emailBody = @"me";
    [mailController setMessageBody:emailBody isHTML:NO];
  [view presentModalViewController:mailController.view animated:YES]; //add to view
Was it helpful?

Solution

No, actually MFMailComposeViewController is a UIViewController subclass and you can only add it inside an UIViewController not an UIView.

Adding an UIViewController inside an UIView couldn't respect the MVC design pattern. The purpose of a view is only to show data sent by the controller and call controller's actions when the user is making an action on the view

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top