Git Product home page Git Product logo

kaslideshow's Introduction

#KASlideShow

Ultra-basic slideshow for iOS (ARC only). Support manual or automatic slideshow, with fade and slide transitions.

Demo screenshot

##Install

###Normal install

Simply copy into your project folder :

  • KASlideShow.h
  • KASlideShow.m

###Using cocoapods

add this line to your Podfile : pod 'KASlideShow'

##Usage

###Creation of a slideshow

_slideshow = [[KASlideShow alloc] initWithFrame:CGRectMake(0,0,320,250)];
[_slideshow setDelay:3]; // Delay between transitions
[_slideshow setTransitionDuration:1]; // Transition duration
[_slideshow setTransitionType:KASlideShowTransitionFade]; // Choose a transition type (fade or slide)
[_slideshow setImagesContentMode:UIViewContentModeScaleAspectFill]; // Choose a content mode for images to display
[_slideshow addImagesFromResources:@[@"test_1.jpeg",@"test_2.jpeg",@"test_3.jpeg"]]; // Add images from resources
[_slideshow addGesture:KASlideShowGestureTap]; // Gesture to go previous/next directly on the image

###Other methods to add images

- (void) addImagesFromResources:(NSArray *) names;
- (void) emptyAndAddImagesFromResources:(NSArray *)names;
- (void) addImage:(UIImage *) image;

###Use of a slideshow

[_slideshow next]; // Go to the next image
[_slideshow previous]; // Got to the previous image

[_slideshow start]; // Start automatic slideshow
[_slideshow stop]; // Stop automatic slideshow

Gestures

KASlideShowDataSource

You can also implement this protocol to use the slideshow in a more memory efficient way.

- (UIImage *)slideShow:(KASlideShow *)slideShow imageForPosition:(KASlideShowPosition)position;

KASlideShowDelegate

Don't forget to set the delegate !

_slideshow.delegate = self;

Delegate

- (void) kaSlideShowDidShowNext:(KASlideShow *) slideShow;
- (void) kaSlideShowDidShowPrevious:(KASlideShow *) slideShow;
- (void) kaSlideShowWillShowNext:(KASlideShow *) slideShow;
- (void) kaSlideShowWillShowPrevious:(KASlideShow *) slideShow;

kaslideshow's People

Contributors

alexiscreuzot avatar jerrygdm avatar sadiq81 avatar realbug avatar kliffy avatar allfake avatar

Watchers

James Cloos avatar Tian LAN 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.