Skip to content

NativeDataSource is an implementation of the UITableViewDataSource protocol that manages the placement of native ads within native contents.

License

Notifications You must be signed in to change notification settings

lovebyte/NativeDataSource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NativeDataSource

CI Status Version License Platform

NativeDataSource is an implementation of the UITableViewDataSource protocol that manages the placement of native ads within native contents.

Usage

Managing data

After loading your data, pass them to NativeDataSource to let it manage:

[nativeDataSource insertData:dataLoaded];

After loading native ad from your ad provider, pass it to NativeDataSource to let it manage:

[nativeDataSource insertNativeAd:nativeAdLoaded];

Displaying data

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

	[nativeDataSource setVisibleIndexPath:indexPath]; // required for dynamic ad placement

	if ([nativeDataSource isNativeAdAtIndexPath:indexPath]) {

		[nativeDataSource.data objectAtIndex:indexPath.row]; // this is native ad

		...

	} else {

		[nativeDataSource.data objectAtIndex:indexPath.row]; // this is native content

		...
	}
}

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS SDK 7.0 and above

Installation

NativeDataSource is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "NativeDataSource"

Author

Steve Sng

License

NativeDataSource is available under the MIT license. See the LICENSE file for more info.

About

NativeDataSource is an implementation of the UITableViewDataSource protocol that manages the placement of native ads within native contents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published