gdavis / FGallery-iPhone

Objective-C based gallery for iPhones
583 stars 144 forks source link

FGallery - A Photo Gallery for iOS

Overview

FGallery is a photo gallery viewer developed for iPhone applications. FGallery implements a delegate style design pattern similar to how UITableViewDelegates work. You may load images from either the local application bundle, or from the network.

Features

Usage

Basic Instantiation

FGallery requires an object to implement the FGalleryViewControllerDelegate protocol in order to act as the photo source for the gallery. Then just push it into the navigation controller stack as you would with any UIViewController.

FGalleryViewController *galleryVC = [[FGalleryViewController alloc] initWithPhotoSource:self];
[self.navigationController pushViewController:galleryVC animated:YES];
[galleryVC release];

Instantiation with Custom Bar Items

FGallery allows you add additional UIBarButtonItems to the UIToolbar that exists within the gallery to perform additional functionality.

UIImage *trashIcon = [UIImage imageNamed:@"photo-gallery-trashcan.png"];
UIImage *captionIcon = [UIImage imageNamed:@"photo-gallery-edit-caption.png"];
UIBarButtonItem *trashButton = [[[UIBarButtonItem alloc] initWithImage:trashIcon style:UIBarButtonItemStylePlain target:self action:@selector(handleTrashButtonTouch:)] autorelease];
UIBarButtonItem *editCaptionButton = [[[UIBarButtonItem alloc] initWithImage:captionIcon style:UIBarButtonItemStylePlain target:self action:@selector(handleEditCaptionButtonTouch:)] autorelease];
NSArray *barItems = [NSArray arrayWithObjects:editCaptionButton, trashButton, nil];

FGalleryViewController *galleryVC = [[FGalleryViewController alloc] initWithPhotoSource:self barItems:barItems];
[self.navigationController pushViewController:galleryVC animated:YES];
[galleryVC release];

Current Project Status

The 1.x version of FGallery is no longer supported. Since I need to make a living, I've been busy contracting and haven't had time to fully support the 1.x versions. However, I am in the midst of slowly rewriting FGallery for a 2.0 version that will modernize the project and also convert it into a Cocoapod that I do plan on supporting. The new version will also use a UICollectionView to display the thumbnail gallery, will allow for custom layouts, and a few more nice updates. Sorry for being busy and not updating as much as I should, but I never thought this project would get as much attention as it has! Thanks for all the contributions and support for the project! -Grant

Changes

1.3

1.2

1.1

1.0

License

(The MIT License)

Copyright © 2010 Grant Davis Interactive, LLC

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.