forked from kirbyt/KTPhotoBrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added root view controller and Flickr data source shell class.
- Loading branch information
Showing
7 changed files
with
155 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/Flickr+JSONSample/Flickr+JSONSample/FlickrPhotosDataSource.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// FlickrPhotosDataSource.h | ||
// Flickr+JSONSample | ||
// | ||
// Created by Kirby Turner on 3/5/11. | ||
// Copyright 2011 White Peak Software Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "KTPhotoBrowserDataSource.h" | ||
|
||
|
||
@interface FlickrPhotosDataSource : NSObject <KTPhotoBrowserDataSource> | ||
{ | ||
|
||
} | ||
|
||
@end |
44 changes: 44 additions & 0 deletions
44
src/Flickr+JSONSample/Flickr+JSONSample/FlickrPhotosDataSource.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// FlickrPhotosDataSource.m | ||
// Flickr+JSONSample | ||
// | ||
// Created by Kirby Turner on 3/5/11. | ||
// Copyright 2011 White Peak Software Inc. All rights reserved. | ||
// | ||
|
||
#import "FlickrPhotosDataSource.h" | ||
|
||
|
||
@implementation FlickrPhotosDataSource | ||
|
||
- (void)dealloc | ||
{ | ||
[super dealloc]; | ||
} | ||
|
||
- (id)init | ||
{ | ||
self = [super init]; | ||
if (self) { | ||
|
||
} | ||
return self; | ||
} | ||
|
||
- (NSInteger)numberOfPhotos | ||
{ | ||
return 0; | ||
} | ||
|
||
// Implement either these, for synchronous images… | ||
- (UIImage *)imageAtIndex:(NSInteger)index | ||
{ | ||
return nil; | ||
} | ||
|
||
- (UIImage *)thumbImageAtIndex:(NSInteger)index | ||
{ | ||
return nil; | ||
} | ||
|
||
@end |
20 changes: 20 additions & 0 deletions
20
src/Flickr+JSONSample/Flickr+JSONSample/RootViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// RootViewController.h | ||
// Flickr+JSONSample | ||
// | ||
// Created by Kirby Turner on 3/5/11. | ||
// Copyright 2011 White Peak Software Inc. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "KTThumbsViewController.h" | ||
|
||
@class FlickrPhotosDataSource; | ||
|
||
@interface RootViewController : KTThumbsViewController | ||
{ | ||
@private | ||
FlickrPhotosDataSource *photos_; | ||
} | ||
|
||
@end |
45 changes: 45 additions & 0 deletions
45
src/Flickr+JSONSample/Flickr+JSONSample/RootViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// RootViewController.m | ||
// Flickr+JSONSample | ||
// | ||
// Created by Kirby Turner on 3/5/11. | ||
// Copyright 2011 White Peak Software Inc. All rights reserved. | ||
// | ||
|
||
#import "RootViewController.h" | ||
#import "FlickrPhotosDataSource.h" | ||
|
||
@interface RootViewController () | ||
- (FlickrPhotosDataSource *)photos; | ||
@end | ||
|
||
@implementation RootViewController | ||
|
||
- (void)dealloc | ||
{ | ||
[super dealloc]; | ||
} | ||
|
||
- (void)viewDidLoad | ||
{ | ||
[super viewDidLoad]; | ||
|
||
[self setDataSource:[self photos]]; | ||
[self setTitle:[NSString stringWithFormat:@"%i Photos", [[self photos] numberOfPhotos]]]; | ||
|
||
// Label back button as "Back". | ||
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Back", @"Back button title") style:UIBarButtonItemStylePlain target:nil action:nil]; | ||
[[self navigationItem] setBackBarButtonItem:backButton]; | ||
[backButton release]; | ||
} | ||
|
||
- (FlickrPhotosDataSource *)photos | ||
{ | ||
if (photos_) { | ||
return photos_; | ||
} | ||
|
||
return nil; | ||
} | ||
|
||
@end |