Skip to content

jhabr/JHSlideShowView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JHSlideShowView

Pod Version Pod Platform Language Pod License

JHSlideShowView is a customizable slideshow view for iOS.

JHSlideShowView

Installation

CocoaPods

Add the following line to your Podfile:

pod 'JHSlideShowView', '~> 1.0'

Then install JHSlideShowView into your project by executing the following code:

pod install

Manual

Drag the JHSlideShowView folder into your project.

Usage

(see sample Xcode project in /Demo)

Initialize the JHSlideShowView in the viewDidLoad method of your controller:

Objective-C
#import "JHSlideShowView.h"

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSArray *images = @[[UIImage imageNamed:@"image1.png"],
                        [UIImage imageNamed:@"image2.png"],
                        [UIImage imageNamed:@"image3.png"]];

    [self.slideShowView animateWithImages:images
                             showDuration:8.f
                       transitionDuration:3.f
                                     loop:YES];
}

If you're using Swift, don't forget to add an Objective-C bridging header to your project's build settings.

Swift
override func viewDidLoad() {
    super.viewDidLoad()
    
    let images: Array<UIImage!> = [
        UIImage(named: "image1.png"),
        UIImage(named: "image2.png"),
        UIImage(named: "image3.png")
    ]
    
    self.slideShowView.animateWithImages(images, showDuration: 8, transitionDuration: 3, loop: true)
}