0

In order to automatically send email in my iOS app, I've been going along with this thread: How to send emails in Swift using Mailgun. I've installed Mailgun successfully with CocoaPods but am still getting the error "Use of unresolved identifier 'Mailgun'' when I reference it in my view controller.

My bridging header file is all set up based on threads like this one: Swift "Bridging-Header.h" file not allowing me to instantiate objective-c classes in .swift files. It looks like this:

#ifndef MailGunTest_Bridging_Header_h
#define MailGunTest_Bridging_Header_h

#import <mailgun/Mailgun.h>

#endif

I've used pods a little bit before and haven't run into this problem but it could be something really obvious. Or, I could be using the framework incorrectly somehow in referencing Mailgun but according to the aforementioned thread that shouldn't be a problem.

I'm not sure what OP means on that thread by "I had to go to Product -> Schemes -> Edit Schemes and add the Pods-mailgun to the top of the list". Did he mean the build list? If so, I tried adding Pods-mailgun to the targets in the build list but it still doesn't seem to be working.

Any help would be greatly appreciated!

Community
  • 1
  • 1
Connor Hargus
  • 317
  • 2
  • 11
  • are you talking about the POD named mailgun or just a pod using mailgun? there's many pods that claim to do this, which one specifically? – Larry Pickles Aug 15 '15 at 21:36
  • The pod named mailgun: pod 'mailgun', '~> 1.0.3' – Connor Hargus Aug 15 '15 at 21:37
  • k, I'm looking at it, thanks, also have you tried to set it up without cocoapods? – Larry Pickles Aug 15 '15 at 21:37
  • Thanks so much! I haven't tried setting it up without cocoapods as I'm not sure what the alternative would be. Download it from the mailgun site? Sorry I'm fairly new to this stuff. – Connor Hargus Aug 15 '15 at 21:42
  • This pod literally has like 4 files that are necessary, I doubt it has too many dependencies, it uses AFNetworking and Foundation, that's basically it, I personally hate cocoapods and think its a uselsss product when you can literally just link things yourself with out all the sort of "black box" crap that can turn up out of nowhere, I'm still looking, but try to install without cocoapods – Larry Pickles Aug 15 '15 at 21:44
  • Also, if you install without cocoapods, make sure you link the import files correctly, I don't know the equivalent in Swift, but in ObjC, this " #import " would be this"import Mailgun.h" without coccoapods – Larry Pickles Aug 15 '15 at 21:47
  • Alright I copied over the files from the Git repository and updated the bridging header and now it seems good to go. Huh, well thanks I wouldn't have thought something might be funky from using cocoapods. Thanks! – Connor Hargus Aug 15 '15 at 21:51
  • yeh, I only use them if the POd requires a full on make build PLUS dependencies of more than 5-7 interlocking pods, which means I never use them, I hope that works and I'm glad I read your post to see the post about this project still being usable after two years of no updates on github. I need to use this in my app as well so you solved my problem by just asking! – Larry Pickles Aug 15 '15 at 21:53

0 Answers0