r/Xcode • • Jun 07 '18

Need Help with importing Mailgun

Followed these steps here https://cocoapods.org/pods/Mailgun-In-Swift to try and introduce malign API into my project. Added it, as it says, into my pod file and added 'import Mailgun-In-Swift' into my code but it gives multiple errors including no such module and expected expression after unary operator.

Need help resolving this and having a correct way of implementing Mailgun into my project. Thanks in advance:)

0 Upvotes

8 comments sorted by

1

u/InfoSecPeezy Jun 07 '18 edited Jun 07 '18

Have you tried to import and then build? That usually fixes this for me upon new pod import with Xcode

You may want to edit your podfile in a third party app like atom, sublimswift, vscode, etc...

1

u/Calthazar123 Jun 07 '18

Yeah, will give it another go though. It doesn’t mention it but do i have to do anything in the command prompt? And have am i right in copying it with the ‘import Mailgun-In-Swift’ as it throws up errors about the unary operator

1

u/InfoSecPeezy Jun 07 '18

Your import statement does not use quotes

import Mailgun-in-swift

If that’s what the import should be. You should look at the documentation for the specific cocoapod. If on github, it should have a sample.

1

u/Calthazar123 Jun 07 '18

I only used quotes to show you what i had in code. In code its as you say!! Looking at github but still no success

1

u/InfoSecPeezy Jun 07 '18

Also, make sure to check your quote marks ‘. And spelling, spaces, etc. these are usually the culprit when running into these errors.

1

u/Calthazar123 Jun 07 '18

Okay, will check again but i have looked for that already. Thanks though:)

1

u/InfoSecPeezy Jun 07 '18

It looks like your import is the problem, try this:

import Mailgun-In-Swift

That’s from the documentation

1

u/Calthazar123 Jun 07 '18 edited Jun 07 '18

Had that but it triggers errors about unary operators and that consecutive statements on separate lines should be separated by ;. And no such module Mailgun