Create compose mail when click button iOS swift
Solution: let receivers = event. receivers != nil ? [ receivers ] : [] let mailComposerVC = MFMailComposeViewController () mailComposerVC. mailComposeDele gate = self // Extremely important to set the --mailComposeDelegate-- property, NOT the --delegate-- property mailComposerVC. setToRecipients (receivers as ? NSArray as ? [ String ]) mailComposerVC. setSubject ( "" ) mailComposerVC. setMessageBody ( "" , isHTML: false ) self . viewControl . present ( mailComposerVC, animated: true , completion: nil ) The above code you have to implement in the action of the button. receivers are the receiving mail id arrays you can pass.Also must have to implement the delegate in the viewController and delegate methods.