objective-ciosthree20

Three20: Photo Viewer customization


I need a gallery in my application and I found this tutorial on how to implement the Three20 into my application: http://www.raywenderlich.com/1430/how-to-use-the-three20-photo-viewer.

I've a storyboard where the root is a Tab Bar Controller. This root controller has a relation with a View Controller with the class PhotoViewController from the above tutorial.

The last step in the tutorial is to add code to the AppDelegate, but in my case I added this code to the PhotoViewController:

#import "PhotoViewController.h"
#import "PhotoSet.h"

@implementation PhotoViewController
@synthesize photoSet = _photoSet;

- (void) viewDidLoad {

    [[TTURLRequestQueue mainQueue] setMaxContentLength:0];

    TTNavigator *navigator = [TTNavigator navigator];
    UIWindow *window = [UIApplication sharedApplication].keyWindow;
    navigator.window = window;

    TTURLMap *map = navigator.URLMap;
    [map from:@"tt://appPhotos" toSharedViewController:[PhotoViewController class]];

    [navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://appPhotos"]];

    self.photoSource = [PhotoSet samplePhotoSet];
}

- (void) dealloc {
    self.photoSet = nil;
}

@end

Here is a image of the result after tabbing the "Gallery" tab in the root tab controller: Gallery

Here is a image when I scroll in the view: Problem with scroll

This is almost fine, but I have some issues:

  1. When I tab the Gallery and the above view appear, there is no way back to the root tab controller. How can I add a back button?
  2. When I swipe in the gallery, the text "Error" is displayed for a while until the image is fully loaded. Why?
  3. When I tab "See All" it shows an list of all images. How can I change the background-color for the navigation bar in the top?

Solution

  • I think that MWPhotoBrowser has a nicer interface than EGOPhotoViewer (feels closer to the native Photos app).

    MWPhotoBrowser is an implementation of a photo browser similar to the native Photos app in iOS. It can display one or more images by providing either UIImage objects, file paths to images on the device, or URLs to images online. The photo browser handles the downloading and caching of photos from the web seamlessly. Photos can be zoomed and panned, and optional (customisable) captions can be displayed. Works on iOS 3.2+. All strings are localisable so they can be used in apps that support multiple languages.