iOS SDK Version
FBNativeAdScrollView
Objective-C
@interfaceFBNativeAdScrollView:UIView
Swift
classFBNativeAdScrollView:UIView
Contains multiple ads in a scroll view.
If adding this view to a XIB or Storyboard, you may recieve the error “Unknown class FBNativeAdScrollView in Interface Builder file” in some cases. This error is caused by the linker failing to include FBNativeAdScrollView in your build. To resolve this, call [FBNativeAdScrollView class] in your project, or add “-all_load -ObjC” to “Other Linker Flags” in your project settings.
- Maximum native ads that this scroll view will load. Defaults to 10. If changed after calling loadAds, all current ads will be discarded and loadAds must be called again.
Declaration
Objective-C@property(nonatomic,readonly)NSUIntegermaximumNativeAdCount;
SwiftvarmaximumNativeAdCount:UInt{get}
- Toggles animating the loaded views. Default is YES.
Declaration
Objective-C@property(nonatomic,assign,unsafe_unretained,readwrite,getter=isAnimationEnabled)BOOLanimationEnabled;
SwiftvarisAnimationEnabled:Bool{getset}
- Horizontal inset for views in the scroll view. Defaults to 8 points.
Declaration
Objective-C@property(nonatomic)CGFloatxInset;
SwiftvarxInset:CGFloat{getset}
- Reloads the same ads for the same manager. Default is NO.
Declaration
Objective-C@property(nonatomic,assign,unsafe_unretained,readwrite,getter=isAdPersistenceEnabled)BOOLadPersistenceEnabled;
SwiftvarisAdPersistenceEnabled:Bool{getset}
- A view controller that is used to present modal content. If nil, the view searches for a view controller.
Declaration
Objective-C@property(nonatomic,weak,nullable)UIViewController*rootViewController;
SwiftweakvarrootViewController:UIViewController?{getset}
- Passes delegate methods from FBNativeAd. Separate delegate calls will be made for each native ad contained.
Declaration
Objective-C@property(nonatomic,weak,nullable)id<FBNativeAdDelegate>delegate;
Swiftweakvardelegate:FBNativeAdDelegate?{getset}
- Creates a native ad horizontal scroll view for a given native ads manager and native ad template. The manager can be preloaded with ads, and loadAds will use the preloaded ads from the manager. Otherwise, the scroll view uses the manager to load ads normally.
Declaration
Objective-C-(nonnullinstancetype)initWithNativeAdsManager:(nonnullFBNativeAdsManager*)managerwithType:(FBNativeAdViewType)type;
Swiftconvenienceinit(nativeAdsManagermanager:FBNativeAdsManager,withtype:FBNativeAdViewType)
Parameters
- Creates a native ad horizontal scroll view for a given native ads manager and native ad template. The manager can be preloaded with ads, and loadAds will use the preloaded ads from the manager. Otherwise, the scroll view uses the manager to load ads normally.
Declaration
Objective-C-(nonnullinstancetype)initWithNativeAdsManager:(nonnullFBNativeAdsManager*)managerwithType:(FBNativeAdViewType)typewithAttributes:(nonnullFBNativeAdViewAttributes*)attributes;
Swiftconvenienceinit(nativeAdsManagermanager:FBNativeAdsManager,withtype:FBNativeAdViewType,withattributes:FBNativeAdViewAttributes)
Parameters
- Creates a native ad horizontal scroll view for a given native ads manager and native ad template. The manager can be preloaded with ads, and loadAds will use the preloaded ads from the manager. Otherwise, the scroll view uses the manager to load ads normally.
Declaration
Objective-C-(nonnullinstancetype)initWithNativeAdsManager:(nonnullFBNativeAdsManager*)managerwithType:(FBNativeAdViewType)typewithAttributes:(nonnullFBNativeAdViewAttributes*)attributeswithMaximum:(NSUInteger)maximumNativeAdCount;
Swiftconvenienceinit(nativeAdsManagermanager:FBNativeAdsManager,withtype:FBNativeAdViewType,withattributes:FBNativeAdViewAttributes,withMaximummaximumNativeAdCount:UInt)
Parameters
- This is a method to create a native ad horizontal scroll view from a user provided view.
Declaration
Objective-C-(nonnullinstancetype)initWithNativeAdsManager:(nonnullFBNativeAdsManager*)managerwithViewProvider:(nonnullUIView*_Nonnull(^)(FBNativeAd*_Nonnull,NSUInteger))childViewProvider;
Swiftconvenienceinit(nativeAdsManagermanager:FBNativeAdsManager,withViewProviderchildViewProvider:@escaping(FBNativeAd,UInt)->UIView)
Parameters
- This is a method to create a native ad horizontal scroll view from a user provided view.
Declaration
Objective-C-(nonnullinstancetype)initWithNativeAdsManager:(nonnullFBNativeAdsManager*)managerwithViewProvider:(nonnullUIView*_Nonnull(^)(FBNativeAd*_Nonnull,NSUInteger))childViewProviderwithMaximum:(NSUInteger)maximumNativeAdCount;
Swiftinit(nativeAdsManagermanager:FBNativeAdsManager,withViewProviderchildViewProvider:@escaping(FBNativeAd,UInt)->UIView,withMaximummaximumNativeAdCount:UInt)
Parameters