Latest 1.3
Homepage https://github.com/zhuxian022/YVBanner
License MIT
Platforms ios 8.0, requires ARC
Dependencies iCarousel, SDWebImage

quickLook

quickLook

Installation

1.cocoapod

pod 'YVBanner', '~> 1.3'

2.add Files to your project

Update

  • 2018.08.29 First version v1.0

  • 2018.08.31 bug fix v1.1

  • 2018.08.31 add AutoScroll v1.2

  • 2018.09.03 support custom animation v1.3

How To Use

import "YVBanner.h"

init YVBanner

_bannerView = [[YVBanner alloc]initWithFrame:CGRectMake(0, Navigation_Height, IPHONE_WIDTH, 300-Navigation_Height)];
[self.view addSubview:_bannerView];

set images

images’s object could be UIImage、NSString(imageLink)、NSUrl

NSArray *array [email protected][[UIImage imageNamed:@"timg-1.jpeg"],@"https://timgsa.baidu.com/timg?image&src=http%bb60.jpg",[NSURL URLWithString:@"https://timgsa.baidu.com/timg?image2f3f36bfef3dd8.jpg"],[UIImage imageNamed:@"timg-2.jpeg"]];
_bannerView.images = array;

set IndicatorType && IndicatorType

_bannerView.indicatorType = YVIndicatorTypePageControl;
_bannerView.indicatorPosition = YVIndicatorPositionRightDown;

set Wrap && CurrentIndex

_bannerView.wrap = YES;
_bannerView.currentIndex = 3;

set AutoScrollTime

_bannerView.timeInverval = 2.0f;

Change Page && Click Page

_bannerView.clickBannerBlock = ^(NSInteger index) {
NSLog(@"clickImageAtIndex:%ld",(long)index);
};
_bannerView.scrollBannerBlock = ^(NSInteger index) {
NSLog(@"scrollToIndex:%ld",(long)index);
};    

Custom Animation

1.set bannerView’s carousel dataSource & delegate

_bannerView.carousel.dataSource = self;
_bannerView.carousel.delegate = self;
_bannerView.carousel.type = iCarouselTypeCustom;

2.implement bannerView’s carousel dataSource & delegate

Please check iCarousel

Latest podspec

{
    "name": "YVBanner",
    "version": "1.3",
    "summary": "A Simple Banner Base On iCarousel",
    "homepage": "https://github.com/zhuxian022/YVBanner",
    "license": "MIT",
    "authors": "Yi Von",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/zhuxian022/YVBanner.git",
        "tag": "1.3"
    },
    "source_files": "YVBanner/**/*.{h,m}",
    "requires_arc": true,
    "dependencies": {
        "iCarousel": [],
        "SDWebImage": []
    }
}

Pin It on Pinterest

Share This