Git Product home page Git Product logo

clautoslideview's Introduction

CLAutoSlideView

🔥 A customized auto slide view! And, infinite loop!

CLAutoSlideView


## Introduction

This is a display of advertising or information.

You can add customized views (such as imageView, webview, textView) into auto slide view with a infinite loop. It's so cool!

If you feel good, please give me a star, thank you very much! ⭐️

## Installation

## Non-CocoaPods Installation

Just drag the CLAutoSlideView folder into your project.

## Usage

* Use by including the following import:
````objc
#import "CLAutoSlideView.h"
  • Demo code:
// add image views
NSMutableArray *viewsArray = [@[] mutableCopy];
    for (int i = 0; i < 3; ++i) {
        UIImageView *imageView = [[UIImageView alloc] init];
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.jpg",i + 1]];
        imageView.image = image;
        imageView.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame));
        [viewsArray addObject:imageView];
    }
    
    CGRect frame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame));
    self.autoSlideView = [CLAutoSlideView autoSlideViewWithFrame:frame
                                                        delegate:self
                                                          images:nil
                                                           count:3
                                               animationInterval:3.0
                                   currentPageIndicatorTintColor:[UIColor orangeColor]
                                          pageIndicatorTintColor:[UIColor lightGrayColor]];
    [self.view addSubview:self.autoSlideView];
    
    // you can init with images, or add later with network images
    [self.autoSlideView setImages:viewsArray];
  • Delegate (@optional):
- (void)autoSlideView:(CLAutoSlideView *)autoSlideView didClickedImageAtIndex:(NSInteger)index;
  • For example:
#pragma mark - CLAutoSlideViewDelegate

- (void)autoSlideView:(CLAutoSlideView *)autoSlideView didClickedImageAtIndex:(NSInteger)index {
    NSLog(@"autoSlideView did Clicked Image At Index:(%zd)", index);
}

// logs
2015-12-23 19:15:11.518 CLAutoSlideView[6629:2491185] autoSlideView did Clicked Image At Index:(1)
2015-12-23 19:15:14.140 CLAutoSlideView[6629:2491185] autoSlideView did Clicked Image At Index:(2)

Support

License

MIT License

clautoslideview's People

Contributors

felixmlians avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.