• Stars
    star
    321
  • Rank 130,752 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The KIImagePager is inspired by foursquare's ImageSlideshow, the user may scroll through images loaded from the Web

KIImagePager

License

Deprecation Notice

Please note I've written this library years ago to be used in a customer's project, it's deprecated by now. In case anyone wants to raise a PR to fix issues or improve something: Go for it, I'll review and merge if suitable. Other than that I'm not going to invest any more work into this. Sorry folks

This UIView Subclass is used to present Images loaded from the Web and is inspired from foursquare's Image Slideshow. The used will be downloaded asynchronously. Former dependencies on SDWebImage have been removed.

This is what the ImagePager looks like when it's set up:

Demo GIF Animation

Implementing the ImagePager is fairly easy, just set it up in Interface Builder or use it in code directly.

Optionally customize the PageControl's appearance:

- (void) viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    _imagePager.pageControl.currentPageIndicatorTintColor = [UIColor lightGrayColor];
    _imagePager.pageControl.pageIndicatorTintColor = [UIColor blackColor];
    _imagePager.pageControlCenter = CGPointMake(CGRectGetWidth(_imagePager.frame) / 2, CGRectGetHeight(_imagePager.frame) - 42);
}

PageControl and ImageCounter can be hidden separately by setting imageCounterDisabled and imageCounterDisabled property. There is also a property hidePageControlForSinglePages.

Now implement it's DataSource and (optionally) Delegate methods:

- (NSArray *) arrayWithImages:(KIImagePager*)pager
{
    return @[
            @"https://raw.github.com/kimar/tapebooth/master/Screenshots/Screen1.png",
            [UIImage imageNamed:@"MySuperImage1"],
            @"https://raw.github.com/kimar/tapebooth/master/Screenshots/Screen2.png",
            [UIImage imageNamed:@"MySuperImage2"],
            @"https://raw.github.com/kimar/tapebooth/master/Screenshots/Screen3.png"
            ];
}

As you can see, it's now perfectly ok to mix urlStrings as well as UIImages inside arrayWithImages DataSource method.

- (UIViewContentMode) contentModeForImage:(NSUInteger)image inPager:(KIImagePager*)pager
{
    return UIViewContentModeScaleAspectFill;
}

Optionally you might define a caption title which will be shown above the images using the captionForImageAtIndex DataSource method.

- (NSString *) captionForImageAtIndex:(NSUInteger)index inPager:(KIImagePager*)pager
{
    return @[
             @"First screenshot",
             @"Another screenshot",
             @"Last one! ;-)"
             ][index];
}

If you'd like to get a SlideShow, just give it an interval for the time between those single slides:

_imagePager.slideshowTimeInterval = 1.5f;

The MIT License (MIT)

Copyright (c) 2013 Marcus Kida

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

DeveloperExcuses

A Mac OS X Screensaver which shows quotes from http://developerexcuses.com, inofficial
Swift
342
star
2

Octosaver

A Mac OS X Screensaver showing http://octodex.github.com Octocats
Objective-C
139
star
3

PulsingLayer

Adds a customizable CALayer halo effect to any arbitrary UIView. Completely written in Swift.
Swift
90
star
4

KIPullToReveal

A UITableView combined with a MKMapView to show both. If scrolled down the TableView will disappear and show the Full MapView and the other way around.
Objective-C
83
star
5

OnelinerKit

A macOS framework to create text based screen savers. 🖥💯
Swift
36
star
6

Camira

An iOS text adventure game engine, inspired by Lifeline and co.
Swift
17
star
7

Himbo

A simple iOS App to create mono colored backgrounds. Written in Swift and supporting 3D Touch on iPhone 6s.
Swift
13
star
8

Promise.swift

A tiny and simple Swift Promise library, written in 33 lines of code 🏄‍♂️
Swift
8
star
9

ghost-aws-s3

Slightly tuned Version of https://www.npmjs.org/package/ghost-s3 to allow Ghost Blog store it's media at Amazon S3.
JavaScript
8
star
10

trianglify-api

A simple Node.js App serving trianglify.js SVG or PNG Images
JavaScript
8
star
11

iDTMF

iDTMF is an iOS App used to generate DTMF- or ZVEI Tone sequences.
Objective-C
7
star
12

TheReservist

Check for available iPhone Reservations @ your local Apple Store
Swift
6
star
13

MagicKit-iOS

MagicKit-iOS is an Objective-C wrapper for libmagic based on MagicKit from https://github.com/aidansteele/MagicKit
C
6
star
14

vatjs

A simple node.js app to check foreign VAT IDs using SOAP via http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
CSS
5
star
15

KITagCloud

A TagCloud inspired by Dominic Wroblewski's DWTagList
Objective-C
4
star
16

KIBackoffTimer

A simple subclassed NSTimer to perform exponential backoff timed tasks
Objective-C
4
star
17

DTMFdroid

An Android App which generates DTMF tones. Get it at the Play Store: https://play.google.com/store/apps/details?id=org.indiecoder.DTMFdroid
Java
4
star
18

tapebooth

An iOS App using the public doctape API to down-/upload images, manipulate and share them
Objective-C
3
star
19

NexmoCli

A Per-User configurable Bash-Script for sending SMS using the Nexmo SMS Gateway.
Shell
3
star
20

jekyll-github

Jekyll Liquid Tag plugin to show GitHub Stars on your static Page / Blog
JavaScript
2
star
21

TNEF.framework

Objective-C iOS Framework to extract the contents of TNEF (aka winmail.dat) files
C
2
star
22

chainsaw

Node.js App using Express to store and deliver Mobile Device Crashlogs
JavaScript
2
star
23

Pushster

An iOS App to receive Push Notifications using web services, half-done, needs someone to finish
Objective-C
2
star
24

NSFailsafety

Some categories to make your Cocoa-Life a bit easier (and, in case, keep your code clean).
Objective-C
2
star
25

is-github-down.hs

A simple Haskell app to check if GitHub is down
Haskell
2
star
26

MKIPorter

Gets you a random free TCP Port using C APIs
Objective-C
2
star
27

blackfish-example

Sample app for https://github.com/elliottminns/blackfish
Swift
1
star
28

ShakeView

A simple category on UIView to perform a vertical or horizontal shake animation.
Swift
1
star
29

Ktor-Middleware

A dead-simple Middleware Implementation for the Ktor Web Framework
Kotlin
1
star
30

GMGridViewStoryboard

This Xcode Project shows you how to combine the GMGridView using the Storyboard technique introduced in iOS 5.
Objective-C
1
star
31

HackerSaver

An (unofficial) Hacker News macOS Screensaver 🖥💯
Swift
1
star
32

Burrito

🌯 Unwrapping your Swift optionals in a type-safe manner, backed by default values.
Swift
1
star
33

KILocationManager

A dead-simple, lightweight, CLLocationManager wrapper.
Objective-C
1
star
34

decky-networkinfo

A Decky Loader Plugin to show detailed information about all Network Interfaces
TypeScript
1
star
35

git-changelog

Bash Script to simply create a CHANGELOG.txt by providing a starting (and optionally an ending) commit id / tag / whatever
Shell
1
star
36

RxLocationPermission

RxCocoa extension for requesting location authorization in CLLocationManager
Swift
1
star
37

dhl-nolp

A Node.js library for tracking DHL shipments using nolp.dhl.de 🚍
JavaScript
1
star
38

toller

A node module to retrieve information from RTA's E-Toll Website
JavaScript
1
star
39

iDOS

Unoffical fork of the dospad SVN repository, concentrating on the iDOS part
C
1
star
40

NSCategories

A collection of Cocoa Categories for iOS and Mac OS X Projects
Objective-C
1
star