Created
December 16, 2014 23:40
-
-
Save gaborcselle/b18b693cfb6da2daa9ce to your computer and use it in GitHub Desktop.
MPTableViewAdPlacer integration overview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MoPub MPTableViewAdPlacer integration overview | |
// In table view controller: | |
self.adPlacer = [MPTableViewAdPlacer placerWithTableView:self.tableView | |
viewController:self | |
defaultAdRenderingClass:[SomeTableViewAdCell class]]; | |
... | |
[self.adPlacer loadAdsForAdUnitID:@"mopub_ad_unit_id"]; | |
// In format definition: | |
@interface SomeTableViewAdCell : UITableViewCell<MPNativeAdRendering> | |
… | |
+ (CGSize)sizeWithMaximumWidth:(CGFloat)maximumWidth { | |
return CGSizeMake(maxWidth, 90f); | |
} | |
- (void)layoutAdAssets:(MPNativeAd *)adData { | |
[adData loadImageIntoImageView:self.adImage]; | |
[adData loadTextIntoLabel:self.adTextLabel]; | |
[adData loadIconIntoImageView:self.advertiserIcon]; | |
[adData loadTitleIntoLabel:self.advertiserNameLabel]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I cant find loadImageIntoImageView, loadTextIntoLabel, loadIconIntoImageView, loadTitleIntoLabel these method in MPNativeAd. Please check and let me know in latest SDK.