title: Three20: Photo Viewer customization
body: <p>I need a gallery in my application and I found this tutorial on how to implement the Three20 into my application: <a href="http://www.raywenderlich.com/1430/how-to-use-the-three20-photo-viewer" rel="nofollow noreferrer">http://www.raywenderlich.com/1430/how-to-use-the-three20-photo-viewer</a>.</p>
  
  <p>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 <em>PhotoViewController</em> from the above tutorial.</p>
  
  <p>The last step in the tutorial is to add code to the AppDelegate, but in my case I added this code to the PhotoViewController:</p>
  
  <pre><code>#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
  </code></pre>
  
  <p>Here is a image of the result after tabbing the "Gallery" tab in the root tab controller:
  <a href="https://i.stack.imgur.com/k9nBf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k9nBf.png" alt="Gallery"></a>
  </p>
  
  <p>Here is a image when I scroll in the view:
  <a href="https://i.stack.imgur.com/Y68kq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y68kq.png" alt="Problem with scroll"></a>
  </p>
  
  <p>This is almost fine, but I have some issues:</p>
  
  <ol>
  <li>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?</li>
  <li>When I swipe in the gallery, the text "Error" is displayed for a while until the image is fully loaded. Why?</li>
  <li>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?</li>
  </ol>