mobile-sdk-ios icon indicating copy to clipboard operation
mobile-sdk-ios copied to clipboard

Cannot implement "ANCustomAdapterBanner" protocol in Swift

Open StefanIntertec opened this issue 3 years ago • 3 comments

My ObjC project works but I have issues with Swift.

Whenever I conform to the "ANCustomAdapterBanner" protocol I receive an error saying I need to implement required methods.

ReuestAdWithSize method is fine, the main issue comes from required delegate, if I declare it like this: "public var delegate: ANCustomAdapterBannerDelegate?" Xcode is complaining that I am not conforming to "ANCustomAdapter". If i click on fix in Xcode it will add this delegate: "public var delegate: ANCustomAdapterDelegate?". Now I have two delegates with same name.

public var delegate: ANCustomAdapterDelegate?
public var delegate: ANCustomAdapterBannerDelegate?

If I remove one of them Xcode is complaining again about missing required delegate. Am I doing something wrong here? Thank you.

StefanIntertec avatar Nov 05 '21 09:11 StefanIntertec

The two variables listed conform to two different delegates so you should probably name them differently. Can you please open a support ticket- https://support.appnexus.com/. More context with your objectives and a full code example would be helpful. Thank you.

Daniel-Berger avatar Feb 16 '22 16:02 Daniel-Berger

I should have included this doc. You should only need to implement the second delegate listed- ANCustomAdapterBannerDelegate. I am not sure why Xcode is telling to conform to both protocols. Can you please share more information with the above support link?

Daniel-Berger avatar Feb 17 '22 16:02 Daniel-Berger

https://user-images.githubusercontent.com/64143812/154640692-872fbe44-af2f-4bbd-86e4-001833217785.mov

Thank you Daniel for you reply. I have recorded short video to show you whats happening.

StefanIntertec avatar Feb 18 '22 07:02 StefanIntertec

Fixed in SDK v8.0 https://github.com/appnexus/mobile-sdk-ios/releases/tag/8.0.0

Kowshickkarthick avatar Dec 01 '22 01:12 Kowshickkarthick