Coder Social home page Coder Social logo

ge-n / ktphotobrowser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nsocheleau/ktphotobrowser

1.0 2.0 0.0 2.17 MB

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

License: MIT License

C 0.93% Objective-C 99.07%

ktphotobrowser's Introduction

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.

ktphotobrowser's People

Contributors

kirbyt avatar henrik avatar nsocheleau avatar ge-n avatar brettg avatar

Stargazers

 avatar

Watchers

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