I am using Google Ad and I am converting GADUnifiedNativeAd
to AnyObject
and converting back original GADUnifiedNativeAd
is failing in Swift 5 . What can be the reason? Before this code working fine in Swift 4.2 and below:
on delegate response of fetching Ad
func adLoader(_ adLoader: GADAdLoader, didReceive nativeAd: GADUnifiedNativeAd) {
let anyObjectTo: AnyObject = nativeAd
if let nativeAd = anyObjectTo as? GADUnifiedNativeAd {
print("success")
} else {
print("failing")
}
}