How can I add iAd or Google AdMob to a Cocos2D project using Swift?

| | August 11, 2015

I’m currently in the process of finishing up my game, and I would like to know how I can integrate iAd or Google AdMob to my Cocos2D project that I have coded in Swift. My knowledge of Objective-C is very, very vague, so I wasn’t able to understand any of the answers about this topic that already exist on StackOverflow.

How can I integrate iAd or Google AdMob into my game? I would like to know how to implement both banner and interstitial ads. (I’m also using Spritebuilder, if that helps with answering this question.)

One Response to “How can I add iAd or Google AdMob to a Cocos2D project using Swift?”

  1. If you already have the code to do what you want in Objective-C, then all you need to do is follow this article to use them in your current project: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html

    And just my 2 cents, I think it’s better for you to learn Objective-C, even tho you might not going to create your projects with it. Currently most of the resources were still using Objective-C for many reasons, and I bet it won’t change much in the next 5 years to come. If you knew it, you can either bridge those code or even better, port them to Swift and use them natively. Objective-C is basically C, if you were good at C/C++, it won’t be a problem to pick it up quickly.

Leave a Reply