1

I am trying to add the Applovin delegates in my SKScene. And when i add AlAdLoadDelegate as delegate, the xcode shows me this error

Type 'GameScene' does not conform to protocol 'ALAdLoadDelegate'

So i think i have to add a protocol manually. But i don't know how to convert this in swift

@protocol ALAdLoadDelegate <NSObject>
-(void)adService:(ALAdService *)adService didLoadAd:(ALAd *)ad;
-(void)adService:(ALAdService *)adService didFailToLoadAdWithError:(int)code;
@end

This is how I am adding AlAdLoadDelegate in my SKScene...

class GameScene: SKScene, GKGameCenterControllerDelegate,SKPhysicsContactDelegate, ALAdLoadDelegate {

.... My code

}

Can anyone help me in integrating Applovin in ios8 or tell me how can i fix these issues?

4

1 回答 1

1

您的 GameScene 不符合协议,因为它需要实现这两个方法(它们不是可选的)。

如果您开始在您的类实现中输入“adService”,您应该会看到在 Swift 中转换的此方法的代码完成 (alt+esc)。

第一种方法在 Swift 中看起来像这样。

func adService(adService: ALAdService, didLoadAd ad: ALAd) {


}
于 2014-11-12T17:37:03.780 回答