I am working on a project where the code is in Objective-C & Swift 3.2,
I am sending mail from Swift file where I need to extend MFMailViewControllerDelgate
but when I Build project I get an error
Can not find protocol declaration for 'MFMailComposeViewControllerDelegate' at Swift Header file
in below code part
@interface EmailManager (SWIFT_EXTENSION("targetname"))
<MFMailComposeViewControllerDelegate>
- (void)mailComposeController:(MFMailComposeViewController *
_Nonnull)controller didFinishWithResult:(MFMailComposeResult)result
error:(NSError * _Nullable)error;
@end
To resolve error I edit swift header file & add Manually <MessageUI/MessageUI.h>
And everything works fine.
but When new changes are made in Project or ad new Swift file this auto-generated file get reset & I get an error again.
please suggest some permanent solution
FYI:
In Auto generate file there is @import MessageUI
In Build Setting there is MessageUI
in Framework
In Build Setting Define Modules set to YES
ignore target name in the code snippet