• Stars
    star
    575
  • Rank 77,081 (Top 2 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 14 years ago
  • Updated over 10 years ago

Reviews

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

Repository Details

KTPhotoBrowser is a lightweight photo browser library for the iPhone and iPod touch that looks and behaves like the iPhone Photos app.

KTPhotoBrowser

KTPhotoBrowser is a lightweight photo browser for the iPhone and iPod touch. It looks and behaves like the Photos app found on the iPhone.

Build the included Sample app to see it in action.

Requirements

Requires iPhone OS SDK 3.0 or greater.

Using KTPhotoBrowser in Your Project

To use KTPhotoBrowser copy the source code into your project then add a data source class for your photos. Here is how:

  1. Clone the KTPhotoBrowser git repository: git clone http://github.com/kirbyt/KTPhotoBrowser.git.
  2. Copy the contents in the folder src/KTPhotoBrowser to your project. A simple way is to use the Finder to drag and drop the src/KTPhotoBrowser directory into your Xcode project. Be sure to mark the "Copy items into destination group's folder (if need)" option.
  3. Add a new class to your project called "DataSource" or something similar. This class MUST implement the protocol KTPhotoBrowserDataSource.
  4. Implement the methods required by the protocol KTPhotoBrowserDataSource.
  5. Implement the optional methods if needed.
  6. Create a view controller that derives from the class KTThumbsViewController and stick it inside a navigation controller.
  7. In your view controller's viewDidLoad method call [self setDataSource:anInstanceOfYourDataSource] to display the list of thumbnails in the scroll view.

You can also load the image viewer directly without the thumbnail list. Just copy the code from didSelectThumbAtIndex: in KTThumbsViewController.

Using the Data Source

Implementing the protocol KTPhotoBrowserDataSource in your data source class decouples KTPhotoBrowser from the logic required to retrieve images. This means you can use KTPhotoBrowser with images stored anywhere be it locally, in Core Data, or on the web. KTPhotoBrowser doesn't care where the photos come from.

Please note KTPhotoBrowser does not manage the photos. It is the data source's responsibility to retrieve and cache images as needed. KTPhotoBrowser only displays the thumbnail and full size images as provided by the data source. It does not manage any local cache or the retrieval of the image from a persistence store.

The sample app includes an example of using SDWebImage to load images asynchronously, with caching.

Status

The project is a work in progress. It is already being used in apps that are available in the App Store, and the goal is to replicate all features found in the Photo app.

TO DO

  • Decouple the photo viewer from the thumbnail viewer.
  • Fix weird animation problem displayed sometimes when rotating a photo.
  • Improve iPad support.

More Repositories

1

KTOneFingerRotationGestureRecognizer

KTOneFingerRotationGestureRecognizer is a custom UIGestureRecognizer for doing one finger rotations in iOS apps.
Objective-C
236
star
2

appdailysales

App Daily Sales is a Python script that downloads daily sales report files from the iTunes Connect web site.
Python
107
star
3

timeline-jekyll-theme

A multipurpose, single page Jekyll theme.
CSS
101
star
4

PhotoWheel

PhotoWheel is a photo browsing app written for the iPad. This is the companion app for the book Learning iPad Programming.
Objective-C
78
star
5

WPSKit

WPSKit contains various tidbits of Objective-C code for iOS and Mac used in different projects at White Peak Software.
Objective-C
61
star
6

KTTextView

KTTextView derives from UITextView enhancing it with new features.
Objective-C
38
star
7

CustomNavBar

Sample iOS project showing how to customize the look of the UINavigationBar.
Objective-C
28
star
8

XcodeCodeSnippets

A collection of user-defined code snippets for Xcode.
Python
22
star
9

KTViewTransitions

A set of iOS sample projects illustrating different ways to transitions between views.
Objective-C
21
star
10

KTDownloadManager

Downloads and caches data retrieved from the web. Written for iOS.
Objective-C
19
star
11

SimpleTimer

A sample iOS app showing how to display a timer.
Objective-C
13
star
12

360idev

Code samples from my upcoming talk at 360iDev San Jose.
Objective-C
7
star
13

KTCsvParser

KTCsvParser is a read-only comma separated value parser written in Objective-C for Mac OS X and iOS.
Objective-C
3
star
14

trace-export

A Python script for exporting Trace GPX files.
Python
3
star
15

CoinToss

CoinToss is a simple console app for Mac OS X.
Objective-C
3
star
16

site-www-thecave-com

Jekyll site for www.thecave.com.
JavaScript
2
star
17

CustomModalView

A sample iPhone project showing one way to display a custom modal view.
Objective-C
1
star
18

site-www-nshappyhour-org

Jekyll site for www.nshappyhour.org.
CSS
1
star
19

site-www-kirbyturner-com

Jekyll site for www.kirbyturner.com.
CSS
1
star