Created
June 5, 2011 22:46
-
-
Save fbettag/1009506 to your computer and use it in GitHub Desktop.
FlowCover XCode
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
#import "FlowCoverView.h" | |
@interface FlowCoverViewController : UIViewController { | |
} | |
@end |
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
#import "AppDelegate.h" | |
#import "FlowCoverView.h" | |
#import "FlowCoverViewController.h" | |
@implementation FlowCoverViewController | |
- (id) init { | |
if (!(self = [super init])) return self; | |
FlowCoverView *fcview = [[FlowCoverView alloc] initWithFrame:CGRectMake(0.0, 0.0, 460.0, 320.0)]; | |
[fcview setDelegate:self]; | |
[fcview setBackgroundColor:[UIColor blackColor]]; | |
[self setView:fcview]; | |
return self; | |
} | |
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | |
return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || | |
(interfaceOrientation == UIInterfaceOrientationLandscapeRight)); | |
} | |
- (void) didReceiveMemoryWarning { | |
[super didReceiveMemoryWarning]; | |
} | |
- (void) dealloc { | |
[super dealloc]; | |
} | |
- (int) flowCoverNumberImages:(FlowCoverView *)view { | |
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; | |
return [appDelegate.locationTableViewController.fetchedResults.fetchedObjects count]; | |
} | |
- (UIImage *) flowCover:(FlowCoverView *)view cover:(int)image { | |
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; | |
NSLog(@"Records found: %i", [appDelegate.locationTableViewController.fetchedResults.fetchedObjects count]); | |
LocationRecord *rec = [appDelegate.locationTableViewController.fetchedResults.fetchedObjects objectAtIndex:image]; | |
return rec.uiimage; | |
} | |
- (void) flowCover:(FlowCoverView *)view didSelect:(int)image { | |
NSLog(@"Selected Index %d", image); | |
} | |
@end |
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
- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { | |
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; | |
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || | |
toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) { | |
[self presentModalViewController:appDelegate.flowCoverViewController animated:NO]; | |
} else { | |
[self dismissModalViewControllerAnimated:NO]; | |
} | |
} |
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
flowCoverViewController = [[FlowCoverViewController alloc] init]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment