smallmuou / PPAdvertisingView

Advertising view for app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PPAdvertisingView

PPAdvertisingView是一个集成UISCrollView与UIPageControll来完成市面上通用的广告页功能. image

WHY

Github中已经能找到类似的开源代码,我为什么要再开发一个呢?主要出于以下几个原因:

  • 代码比较混乱
  • 耦合度太高

Configure

CocoaPods
  • 添加Podfile,添加pod "PPAdvertisingView"
Manual
  • 拷贝PPAdvertisingView.h与PPAdvertisingView.m到你的工程中
  • 引入SDWebImage第三方库

USAGE

#import "PPAdvertisingView.h"

...

NSMutableArray* items = [NSMutableArray array];

{
    PPAdvertisingItem* item = [PPAdvertisingItem itemWithTitle:@"本地图片1" contentURL:@"http://www.baidu.com"];
    item.image = [UIImage imageNamed:@"1.jpg"];
    [items addObject:item];
}

PPAdvertisingView* adView = [[PPAdvertisingView alloc] initWithFrame:CGRectMake(0, 50, self.view.bounds.size.width, 200) advertisingItems:items touchAction:^(PPAdvertisingItem *item) {
    NSLog(@"点击 %@", item.title);
}];

[self.view addSubview:adView];

LICENSE

This codes follow MIT LICENSE.

About

Advertising view for app.

License:MIT License


Languages

Language:Objective-C 95.2%Language:Ruby 4.8%