JHSlideShowView
is a customizable slideshow view for iOS.
Add the following line to your Podfile:
pod 'JHSlideShowView', '~> 1.0'
Then install JHSlideShowView
into your project by executing the following code:
pod install
Drag the JHSlideShowView
folder into your project.
(see sample Xcode project in /Demo
)
Initialize the JHSlideShowView
in the viewDidLoad
method of your controller:
#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
.
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)
}