├── .gitignore ├── Classes ├── Define.h ├── PagesListController.h ├── PageController.h ├── BaseViewController.h ├── BaseTableViewController.h ├── PageScrollContainer.h ├── PageScrollingAppDelegate.h ├── PageController.m ├── BaseViewController.m ├── PageScrollingAppDelegate.m ├── BaseTableViewController.m ├── PagesListController.m └── PageScrollContainer.m ├── main.m ├── README.markdown ├── PageScrolling_Prefix.pch ├── Info.plist ├── PagesListController.m.xib ├── PageController.xib ├── MainWindow.xib ├── PageScrollContainer.xib └── PageScrolling.xcodeproj └── project.pbxproj /.gitignore: -------------------------------------------------------------------------------- 1 | # xcode noise 2 | build/* 3 | *.pbxuser 4 | *.mode1v3 5 | *.perspectivev3 6 | 7 | # old skool 8 | .svn 9 | 10 | # osx noise 11 | .DS_Store 12 | profile 13 | Appstore 14 | Adhoc 15 | AdhocFS -------------------------------------------------------------------------------- /Classes/Define.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Define.h 3 | * PageScrolling 4 | * 5 | * Created by Anthony Mittaz on 23/03/09. 6 | * Copyright 2009 Anthony Mittaz. All rights reserved. 7 | * 8 | */ 9 | 10 | // Defaults Preferences 11 | #define RestoreLocation @"RestoreLocation" -------------------------------------------------------------------------------- /Classes/PagesListController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PagesListController.h 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseTableViewController.h" 11 | 12 | @interface PagesListController : BaseTableViewController { 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright Anthony Mittaz 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | Based on this code (thanks to Matt): 2 | http://cocoawithlove.com/2009/01/multiple-virtual-pages-in-uiscrollview.html 3 | 4 | Basically you create 2 controllers on your scroll container nib, and then add loadContent: 5 | to your controller and the scroll container controller will handle all the job for you. 6 | 7 | It is showing how to remember the last user known position. 8 | 9 | Know limitation: 10 | You cannot have a up/down scrolling view on your page. -------------------------------------------------------------------------------- /Classes/PageController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PageController.h 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseViewController.h" 11 | 12 | @interface PageController : BaseViewController { 13 | UILabel *_label; 14 | 15 | NSInteger _pageNumber; 16 | } 17 | 18 | @property (nonatomic, retain) IBOutlet UILabel *label; 19 | @property (nonatomic) NSInteger pageNumber; 20 | 21 | - (void)loadContent:(id)sender; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/BaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.h 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface BaseViewController : UIViewController { 13 | // App Delegate 14 | PageScrollingAppDelegate *_appDelegate; 15 | } 16 | 17 | @property (nonatomic, retain) PageScrollingAppDelegate *appDelegate; 18 | 19 | - (void)loadAppDelegate:(id)sender; 20 | - (void)restoreLevelWithSelectionArray:(NSArray *)selectionArray; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/BaseTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseTableViewController.h 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface BaseTableViewController : UITableViewController { 13 | // App Delegate 14 | PageScrollingAppDelegate *_appDelegate; 15 | } 16 | 17 | @property (nonatomic, retain) PageScrollingAppDelegate *appDelegate; 18 | 19 | - (void)loadAppDelegate:(id)sender; 20 | - (void)restoreLevelWithSelectionArray:(NSArray *)selectionArray; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /PageScrolling_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'PageScrolling' target in the 'PageScrolling' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #import "Define.h" 9 | #import "PageScrollingAppDelegate.h" 10 | #endif 11 | 12 | //Right-click on your target and click Get Info. Select the Build tab. Make sure Configuration is set to Debug. Add -DDEBUG to the Other C Flags of your target. 13 | // 14 | //And that’s about it. When you want to log only in debug builds use DLog(). In release builds DLog() will be compiled as an empty comment. Otherwise use ALog() for logging in both debug and release builds. (A as in always.) 15 | #ifdef DEBUG 16 | # define DLog(...) NSLog(__VA_ARGS__) 17 | #else 18 | # define DLog(...) /* */ 19 | #endif 20 | #define ALog(...) NSLog(__VA_ARGS__) 21 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /Classes/PageScrollContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // PageScrollContainer.h 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseViewController.h" 11 | 12 | @class PageController; 13 | 14 | @interface PageScrollContainer : BaseViewController { 15 | UIPageControl *_pageControl; 16 | UIScrollView *_scrollView; 17 | NSInteger _initialPosition; 18 | CGFloat _lastScrolledXPosition; 19 | 20 | PageController *_firstController; 21 | PageController *_secondController; 22 | } 23 | 24 | @property (nonatomic, retain) IBOutlet UIPageControl *pageControl; 25 | @property (nonatomic, retain) IBOutlet UIScrollView *scrollView; 26 | @property (nonatomic) NSInteger initialPosition; 27 | @property (nonatomic) CGFloat lastScrolledXPosition; 28 | 29 | @property (nonatomic, retain) IBOutlet PageController *firstController; 30 | @property (nonatomic, retain) IBOutlet PageController *secondController; 31 | 32 | - (IBAction)loadPage:(id)sender; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/PageScrollingAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // PageScrollingAppDelegate.h 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright Anthony Mittaz 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PageScrollingAppDelegate : NSObject { 12 | // Load user interface 13 | UIWindow *_window; 14 | UINavigationController *_navigationController; 15 | // Remember last saved location 16 | NSUserDefaults *_userDefaults; 17 | NSMutableArray *_savedLocation; 18 | // Content Array 19 | NSArray *_content; 20 | } 21 | 22 | @property (nonatomic, retain) IBOutlet UIWindow *window; 23 | @property (nonatomic, retain) IBOutlet UINavigationController *navigationController; 24 | 25 | @property (nonatomic, retain) NSUserDefaults *userDefaults; 26 | @property (nonatomic, retain) NSMutableArray *savedLocation; 27 | 28 | @property (nonatomic, retain) NSArray *content; 29 | 30 | - (void)loadUserDefaults:(id)sender; 31 | - (void)loadLastSavedLocation:(id)sender; 32 | 33 | - (void)restoreLevelWithSelectionArray:(NSArray *)selectionArray; 34 | 35 | - (void)loadTableContent:(id)sender; 36 | 37 | @end 38 | 39 | -------------------------------------------------------------------------------- /Classes/PageController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PageController.m 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import "PageController.h" 10 | 11 | @implementation PageController 12 | 13 | @synthesize label=_label; 14 | @synthesize pageNumber=_pageNumber; 15 | 16 | 17 | // The designated initializer. Override to perform setup that is required before the view is loaded. 18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 19 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { 20 | // Custom initializations 21 | self.pageNumber = -1; 22 | } 23 | return self; 24 | } 25 | 26 | /* 27 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 28 | - (void)loadView { 29 | } 30 | */ 31 | 32 | 33 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 34 | - (void)viewDidLoad { 35 | [super viewDidLoad]; 36 | 37 | if (self.pageNumber >= 0) { 38 | [self loadContent:self]; 39 | } 40 | } 41 | 42 | - (void)loadContent:(id)sender 43 | { 44 | NSInteger count = [self.appDelegate.content count]; 45 | if (self.pageNumber < count) { 46 | self.label.text = [self.appDelegate.content objectAtIndex:self.pageNumber]; 47 | } 48 | } 49 | 50 | /* 51 | // Override to allow orientations other than the default portrait orientation. 52 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 53 | // Return YES for supported orientations 54 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 55 | } 56 | */ 57 | 58 | #pragma mark - 59 | #pragma mark Memory Warning: 60 | 61 | - (void)didReceiveMemoryWarning { 62 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 63 | // Release anything that's not essential, such as cached data 64 | DLog(@"Oups, time to release memory"); 65 | } 66 | 67 | 68 | - (void)dealloc { 69 | [_label release]; 70 | 71 | [super dealloc]; 72 | } 73 | 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Classes/BaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.m 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import "BaseViewController.h" 10 | 11 | 12 | @implementation BaseViewController 13 | 14 | @synthesize appDelegate=_appDelegate; 15 | 16 | /* 17 | // The designated initializer. Override to perform setup that is required before the view is loaded. 18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 19 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { 20 | // Custom initialization 21 | } 22 | return self; 23 | } 24 | */ 25 | 26 | /* 27 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 28 | - (void)loadView { 29 | } 30 | */ 31 | 32 | #pragma mark - 33 | #pragma mark View Setup: 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | 38 | // Make sure the application delegate is loaded 39 | [self loadAppDelegate:self]; 40 | } 41 | 42 | #pragma mark - 43 | #pragma mark Load Application Delegate: 44 | 45 | - (void)loadAppDelegate:(id)sender 46 | { 47 | if (!self.appDelegate) { 48 | self.appDelegate = (PageScrollingAppDelegate *)[[UIApplication sharedApplication]delegate]; 49 | } 50 | } 51 | 52 | #pragma mark - 53 | #pragma mark Restore to last known user location: 54 | 55 | - (void)restoreLevelWithSelectionArray:(NSArray *)selectionArray 56 | { 57 | // noting 58 | } 59 | 60 | 61 | /* 62 | // Override to allow orientations other than the default portrait orientation. 63 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 64 | // Return YES for supported orientations 65 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 66 | } 67 | */ 68 | 69 | - (void)didReceiveMemoryWarning { 70 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 71 | // Release anything that's not essential, such as cached data 72 | DLog(@"Oups, time to release memory"); 73 | } 74 | 75 | 76 | - (void)dealloc { 77 | [_appDelegate release]; 78 | 79 | [super dealloc]; 80 | } 81 | 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Classes/PageScrollingAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // PageScrollingAppDelegate.m 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright Anthony Mittaz 2009. All rights reserved. 7 | // 8 | 9 | #import "PageScrollingAppDelegate.h" 10 | 11 | 12 | @implementation PageScrollingAppDelegate 13 | 14 | @synthesize window=_window; 15 | @synthesize navigationController=_navigationController; 16 | @synthesize userDefaults=_userDefaults; 17 | @synthesize savedLocation=_savedLocation; 18 | @synthesize content=_content; 19 | 20 | #pragma mark - 21 | #pragma mark Setup your appliation here: 22 | 23 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 24 | // Configure and show the window 25 | [self.window addSubview:[self.navigationController view]]; 26 | [self.window makeKeyAndVisible]; 27 | // Populate table content array with fake data 28 | [self loadTableContent:self]; 29 | // Last known user location 30 | [self loadUserDefaults:self]; 31 | [self loadLastSavedLocation:self]; 32 | } 33 | 34 | #pragma mark - 35 | #pragma mark Load Application Delegate: 36 | 37 | - (void)loadTableContent:(id)sender 38 | { 39 | if (!self.content) { 40 | self.content = [NSArray arrayWithObjects:@"Page 1", @"Page 2", @"Page 3", @"Page 4", @"Page 5", nil ]; 41 | } 42 | } 43 | 44 | #pragma mark - 45 | #pragma mark User defaults: 46 | 47 | - (void)loadUserDefaults:(id)sender 48 | { 49 | self.userDefaults = [NSUserDefaults standardUserDefaults]; 50 | } 51 | 52 | #pragma mark - 53 | #pragma mark Last Saved Location: 54 | 55 | - (void)loadLastSavedLocation:(id)sender 56 | { 57 | // load the stored preference of the user's last location from a previous launch 58 | NSMutableArray *tempMutableCopy = [[self.userDefaults objectForKey:RestoreLocation] mutableCopy]; 59 | self.savedLocation = tempMutableCopy; 60 | [tempMutableCopy release]; 61 | 62 | if (self.savedLocation == nil) { 63 | // user has not launched this app nor navigated to a particular level yet, start at level 1, with no selection 64 | 65 | self.savedLocation = [NSMutableArray arrayWithObjects: 66 | @"-1", 67 | nil]; 68 | } 69 | 70 | [self restoreLevelWithSelectionArray:self.savedLocation]; 71 | } 72 | 73 | #pragma mark - 74 | #pragma mark Restore Last Known User Location: 75 | 76 | - (void)restoreLevelWithSelectionArray:(NSArray *)selectionArray 77 | { 78 | NSInteger item = [[selectionArray objectAtIndex:0]integerValue]; 79 | if (item != -1) { 80 | [self.navigationController.visibleViewController performSelector:@selector(restoreLevelWithSelectionArray:) withObject:selectionArray]; 81 | } 82 | } 83 | 84 | #pragma mark - 85 | #pragma mark Save what's required before quitting: 86 | 87 | - (void)applicationWillTerminate:(UIApplication *)application { 88 | // Save data if appropriate 89 | // remember the user last location 90 | [self.userDefaults setObject:self.savedLocation forKey:RestoreLocation]; 91 | } 92 | 93 | #pragma mark - 94 | #pragma mark Dealloc: 95 | 96 | - (void)dealloc { 97 | [_content release]; 98 | [_userDefaults release]; 99 | [_savedLocation release]; 100 | [_navigationController release]; 101 | [_window release]; 102 | [super dealloc]; 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /Classes/BaseTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseTableViewController.m 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewController.h" 10 | 11 | 12 | @implementation BaseTableViewController 13 | 14 | @synthesize appDelegate=_appDelegate; 15 | 16 | /* 17 | - (id)initWithStyle:(UITableViewStyle)style { 18 | // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 19 | if (self = [super initWithStyle:style]) { 20 | } 21 | return self; 22 | } 23 | */ 24 | 25 | 26 | #pragma mark - 27 | #pragma mark View Setup: 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | 32 | // Make sure the application delegate is loaded 33 | [self loadAppDelegate:self]; 34 | } 35 | 36 | #pragma mark - 37 | #pragma mark Load Application Delegate: 38 | 39 | - (void)loadAppDelegate:(id)sender 40 | { 41 | if (!self.appDelegate) { 42 | self.appDelegate = (PageScrollingAppDelegate *)[[UIApplication sharedApplication]delegate]; 43 | } 44 | } 45 | 46 | #pragma mark - 47 | #pragma mark Restore to last known user location: 48 | 49 | - (void)restoreLevelWithSelectionArray:(NSArray *)selectionArray 50 | { 51 | // noting 52 | } 53 | 54 | /* 55 | - (void)viewWillAppear:(BOOL)animated { 56 | [super viewWillAppear:animated]; 57 | } 58 | */ 59 | /* 60 | - (void)viewDidAppear:(BOOL)animated { 61 | [super viewDidAppear:animated]; 62 | } 63 | */ 64 | /* 65 | - (void)viewWillDisappear:(BOOL)animated { 66 | [super viewWillDisappear:animated]; 67 | } 68 | */ 69 | /* 70 | - (void)viewDidDisappear:(BOOL)animated { 71 | [super viewDidDisappear:animated]; 72 | } 73 | */ 74 | 75 | /* 76 | // Override to allow orientations other than the default portrait orientation. 77 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 78 | // Return YES for supported orientations 79 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 80 | } 81 | */ 82 | 83 | - (void)didReceiveMemoryWarning { 84 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 85 | // Release anything that's not essential, such as cached data 86 | DLog(@"Oups, time to release memory"); 87 | } 88 | 89 | #pragma mark Table view methods 90 | 91 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 92 | return 1; 93 | } 94 | 95 | 96 | // Customize the number of rows in the table view. 97 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 98 | return 0; 99 | } 100 | 101 | 102 | // Customize the appearance of table view cells. 103 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 104 | 105 | static NSString *CellIdentifier = @"Cell"; 106 | 107 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 108 | if (cell == nil) { 109 | cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; 110 | } 111 | 112 | // Set up the cell... 113 | 114 | return cell; 115 | } 116 | 117 | 118 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 119 | // Navigation logic may go here. Create and push another view controller. 120 | // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; 121 | // [self.navigationController pushViewController:anotherViewController]; 122 | // [anotherViewController release]; 123 | } 124 | 125 | 126 | /* 127 | // Override to support conditional editing of the table view. 128 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 129 | // Return NO if you do not want the specified item to be editable. 130 | return YES; 131 | } 132 | */ 133 | 134 | 135 | /* 136 | // Override to support editing the table view. 137 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 138 | 139 | if (editingStyle == UITableViewCellEditingStyleDelete) { 140 | // Delete the row from the data source 141 | [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; 142 | } 143 | else if (editingStyle == UITableViewCellEditingStyleInsert) { 144 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 145 | } 146 | } 147 | */ 148 | 149 | 150 | /* 151 | // Override to support rearranging the table view. 152 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { 153 | } 154 | */ 155 | 156 | 157 | /* 158 | // Override to support conditional rearranging of the table view. 159 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { 160 | // Return NO if you do not want the item to be re-orderable. 161 | return YES; 162 | } 163 | */ 164 | 165 | 166 | - (void)dealloc { 167 | [_appDelegate release]; 168 | 169 | [super dealloc]; 170 | } 171 | 172 | 173 | @end 174 | 175 | -------------------------------------------------------------------------------- /Classes/PagesListController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PagesListController.m 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import "PagesListController.h" 10 | #import "PageScrollContainer.h" 11 | 12 | @implementation PagesListController 13 | 14 | /* 15 | - (id)initWithStyle:(UITableViewStyle)style { 16 | // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 17 | if (self = [super initWithStyle:style]) { 18 | } 19 | return self; 20 | } 21 | */ 22 | 23 | #pragma mark - 24 | #pragma mark View Setup: 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | // Make sure the application delegate is loaded 30 | [self loadAppDelegate:self]; 31 | } 32 | 33 | #pragma mark - 34 | #pragma mark Restore to last known user location: 35 | 36 | - (void)restoreLevelWithSelectionArray:(NSArray *)selectionArray 37 | { 38 | // Just in cas appDelegate isn't already loaded 39 | [self loadAppDelegate:self]; 40 | 41 | if ([selectionArray count] > 0) { 42 | // Push a new view there 43 | PageScrollContainer *controller = [[PageScrollContainer alloc]initWithNibName:@"PageScrollContainer" bundle:nil]; 44 | NSInteger savedIndex = [[selectionArray objectAtIndex:0]integerValue]; 45 | controller.initialPosition = savedIndex; 46 | // Make sur not to animation the push !!! 47 | [self.navigationController pushViewController:controller animated:FALSE]; 48 | [controller release]; 49 | } 50 | } 51 | 52 | 53 | /* 54 | - (void)viewWillAppear:(BOOL)animated { 55 | [super viewWillAppear:animated]; 56 | } 57 | */ 58 | /* 59 | - (void)viewDidAppear:(BOOL)animated { 60 | [super viewDidAppear:animated]; 61 | } 62 | */ 63 | /* 64 | - (void)viewWillDisappear:(BOOL)animated { 65 | [super viewWillDisappear:animated]; 66 | } 67 | */ 68 | /* 69 | - (void)viewDidDisappear:(BOOL)animated { 70 | [super viewDidDisappear:animated]; 71 | } 72 | */ 73 | 74 | /* 75 | // Override to allow orientations other than the default portrait orientation. 76 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 77 | // Return YES for supported orientations 78 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 79 | } 80 | */ 81 | 82 | #pragma mark - 83 | #pragma mark Memory Warning: 84 | 85 | - (void)didReceiveMemoryWarning { 86 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 87 | // Release anything that's not essential, such as cached data 88 | } 89 | 90 | #pragma mark Table view methods 91 | 92 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 93 | return 1; 94 | } 95 | 96 | 97 | // Customize the number of rows in the table view. 98 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 99 | return [self.appDelegate.content count]; 100 | } 101 | 102 | 103 | // Customize the appearance of table view cells. 104 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 105 | 106 | static NSString *CellIdentifier = @"Cell"; 107 | 108 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 109 | if (cell == nil) { 110 | cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; 111 | } 112 | 113 | // Set up the cell... 114 | cell.text = [self.appDelegate.content objectAtIndex:indexPath.row]; 115 | 116 | return cell; 117 | } 118 | 119 | 120 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 121 | // Navigation logic may go here. Create and push another view controller. 122 | // Push a new view there 123 | PageScrollContainer *controller = [[PageScrollContainer alloc]initWithNibName:@"PageScrollContainer" bundle:nil]; 124 | controller.initialPosition = indexPath.row; 125 | [self.navigationController pushViewController:controller animated:TRUE]; 126 | [controller release]; 127 | // Save last user known location 128 | [self.appDelegate.savedLocation replaceObjectAtIndex:0 withObject:[NSString stringWithFormat:@"%d", indexPath.row]]; 129 | } 130 | 131 | - (UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath 132 | { 133 | return UITableViewCellAccessoryDisclosureIndicator; 134 | } 135 | 136 | 137 | /* 138 | // Override to support conditional editing of the table view. 139 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 140 | // Return NO if you do not want the specified item to be editable. 141 | return YES; 142 | } 143 | */ 144 | 145 | 146 | /* 147 | // Override to support editing the table view. 148 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 149 | 150 | if (editingStyle == UITableViewCellEditingStyleDelete) { 151 | // Delete the row from the data source 152 | [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; 153 | } 154 | else if (editingStyle == UITableViewCellEditingStyleInsert) { 155 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 156 | } 157 | } 158 | */ 159 | 160 | 161 | /* 162 | // Override to support rearranging the table view. 163 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { 164 | } 165 | */ 166 | 167 | 168 | /* 169 | // Override to support conditional rearranging of the table view. 170 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { 171 | // Return NO if you do not want the item to be re-orderable. 172 | return YES; 173 | } 174 | */ 175 | 176 | 177 | - (void)dealloc { 178 | 179 | [super dealloc]; 180 | } 181 | 182 | 183 | @end 184 | 185 | -------------------------------------------------------------------------------- /PagesListController.m.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 528 5 | 9G55 6 | 677 7 | 949.43 8 | 353.00 9 | 10 | YES 11 | 12 | 13 | 14 | YES 15 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 16 | 17 | 18 | YES 19 | 20 | YES 21 | 22 | 23 | YES 24 | 25 | 26 | 27 | YES 28 | 29 | IBFilesOwner 30 | 31 | 32 | IBFirstResponder 33 | 34 | 35 | 36 | 274 37 | {320, 416} 38 | 39 | NO 40 | YES 41 | NO 42 | NO 43 | 1 44 | 1 45 | 0 46 | YES 47 | 4.400000e+01 48 | 1.000000e+01 49 | 1.000000e+01 50 | 51 | 52 | 53 | 54 | YES 55 | 56 | 57 | view 58 | 59 | 60 | 61 | 4 62 | 63 | 64 | 65 | 66 | YES 67 | 68 | 0 69 | 70 | YES 71 | 72 | 73 | 74 | 75 | 76 | -1 77 | 78 | 79 | RmlsZSdzIE93bmVyA 80 | 81 | 82 | -2 83 | 84 | 85 | 86 | 87 | 3 88 | 89 | 90 | 91 | 92 | 93 | 94 | YES 95 | 96 | YES 97 | -1.CustomClassName 98 | -2.CustomClassName 99 | 3.IBEditorWindowLastContentRect 100 | 3.IBPluginDependency 101 | 102 | 103 | YES 104 | PagesListController 105 | UIResponder 106 | {{433, 166}, {320, 416}} 107 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 108 | 109 | 110 | 111 | YES 112 | 113 | YES 114 | 115 | 116 | YES 117 | 118 | 119 | 120 | 121 | YES 122 | 123 | YES 124 | 125 | 126 | YES 127 | 128 | 129 | 130 | 4 131 | 132 | 133 | 134 | YES 135 | 136 | PagesListController 137 | UITableViewController 138 | 139 | YES 140 | 141 | YES 142 | loadAppDelegate: 143 | loadTableContent: 144 | 145 | 146 | YES 147 | id 148 | id 149 | 150 | 151 | 152 | IBProjectSource 153 | Classes/PagesListController.h 154 | 155 | 156 | 157 | 158 | 0 159 | PageScrolling.xcodeproj 160 | 3 161 | 162 | 163 | -------------------------------------------------------------------------------- /PageController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 528 5 | 9G55 6 | 677 7 | 949.43 8 | 353.00 9 | 10 | YES 11 | 12 | 13 | 14 | YES 15 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 16 | 17 | 18 | YES 19 | 20 | YES 21 | 22 | 23 | YES 24 | 25 | 26 | 27 | YES 28 | 29 | IBFilesOwner 30 | 31 | 32 | IBFirstResponder 33 | 34 | 35 | 36 | 292 37 | 38 | YES 39 | 40 | 41 | 292 42 | {{0, 198}, {320, 21}} 43 | 44 | NO 45 | YES 46 | NO 47 | Label 48 | 49 | Helvetica-Bold 50 | 1.700000e+01 51 | 16 52 | 53 | 54 | 1 55 | MCAwIDAAA 56 | 57 | 58 | 1 59 | 1.000000e+01 60 | 1 61 | 62 | 63 | {320, 416} 64 | 65 | 66 | 3 67 | MSAwAA 68 | 69 | 70 | 71 | 72 | 73 | YES 74 | 75 | 76 | view 77 | 78 | 79 | 80 | 3 81 | 82 | 83 | 84 | label 85 | 86 | 87 | 88 | 5 89 | 90 | 91 | 92 | 93 | YES 94 | 95 | 0 96 | 97 | YES 98 | 99 | 100 | 101 | 102 | 103 | 1 104 | 105 | 106 | YES 107 | 108 | 109 | 110 | 111 | 112 | -1 113 | 114 | 115 | RmlsZSdzIE93bmVyA 116 | 117 | 118 | -2 119 | 120 | 121 | 122 | 123 | 4 124 | 125 | 126 | 127 | 128 | 129 | 130 | YES 131 | 132 | YES 133 | -1.CustomClassName 134 | -2.CustomClassName 135 | 1.IBEditorWindowLastContentRect 136 | 1.IBPluginDependency 137 | 4.IBPluginDependency 138 | 139 | 140 | YES 141 | PageController 142 | UIResponder 143 | {{354, 440}, {320, 416}} 144 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 145 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 146 | 147 | 148 | 149 | YES 150 | 151 | YES 152 | 153 | 154 | YES 155 | 156 | 157 | 158 | 159 | YES 160 | 161 | YES 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 5 169 | 170 | 171 | 172 | YES 173 | 174 | BaseViewController 175 | UIViewController 176 | 177 | loadAppDelegate: 178 | id 179 | 180 | 181 | IBProjectSource 182 | Classes/BaseViewController.h 183 | 184 | 185 | 186 | PageController 187 | BaseViewController 188 | 189 | loadContent: 190 | id 191 | 192 | 193 | label 194 | UILabel 195 | 196 | 197 | IBProjectSource 198 | Classes/PageController.h 199 | 200 | 201 | 202 | 203 | 0 204 | PageScrolling.xcodeproj 205 | 3 206 | 207 | 208 | -------------------------------------------------------------------------------- /Classes/PageScrollContainer.m: -------------------------------------------------------------------------------- 1 | // 2 | // PageScrollContainer.m 3 | // PageScrolling 4 | // 5 | // Created by Anthony Mittaz on 23/03/09. 6 | // Copyright 2009 Anthony Mittaz. All rights reserved. 7 | // 8 | 9 | #import "PageScrollContainer.h" 10 | #import "PageController.h" 11 | 12 | 13 | @implementation PageScrollContainer 14 | 15 | @synthesize pageControl=_pageControl; 16 | @synthesize scrollView=_scrollView; 17 | @synthesize initialPosition=_initialPosition; 18 | @synthesize lastScrolledXPosition=_lastScrolledXPosition; 19 | @synthesize firstController=_firstController; 20 | @synthesize secondController=_secondController; 21 | 22 | 23 | // The designated initializer. Override to perform setup that is required before the view is loaded. 24 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 25 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { 26 | // Custom initialization 27 | self.initialPosition = 0; 28 | self.lastScrolledXPosition = 0.0; 29 | } 30 | return self; 31 | } 32 | 33 | /* 34 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 35 | - (void)loadView { 36 | } 37 | */ 38 | 39 | 40 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 41 | - (void)viewDidLoad { 42 | [super viewDidLoad]; 43 | 44 | // Set navigation title 45 | self.navigationItem.title = @"Scroll Left or Right"; 46 | 47 | // init second view 48 | [self.scrollView addSubview:self.secondController.view]; 49 | self.secondController.view.frame = CGRectMake(self.scrollView.frame.origin.x, self.scrollView.frame.size.height, self.scrollView.frame.size.width, self.scrollView.frame.size.height); 50 | // init first view 51 | self.firstController.view.frame = self.scrollView.frame; 52 | [self.scrollView addSubview:self.firstController.view]; 53 | 54 | // check the number of favorites 55 | NSInteger count = [self.appDelegate.content count]; 56 | // should update page control 57 | self.pageControl.numberOfPages = count; 58 | // update frame size width according to the number of favorites 59 | self.scrollView.contentSize = CGSizeMake(count * 320.0, self.scrollView.frame.size.height); 60 | // get the location position 61 | //NSInteger position = [self.appDelegate.userdb intForQuery:@"select position from location where location_id = ?", self.location_id]; 62 | NSInteger position = self.initialPosition; 63 | // scroll to first view 64 | CGRect viewFrame = self.scrollView.frame; 65 | if (position != 0) { 66 | [self.scrollView scrollRectToVisible:CGRectMake(position * viewFrame.size.width, self.scrollView.frame.origin.x, viewFrame.size.width, viewFrame.size.height) animated:FALSE]; 67 | } else { 68 | self.firstController.pageNumber = position; 69 | [self.firstController loadContent:self]; 70 | CGRect firstFrame = self.scrollView.frame; 71 | self.firstController.view.frame = CGRectMake(position * firstFrame.size.width, 0.0, firstFrame.size.width, firstFrame.size.height); 72 | 73 | self.lastScrolledXPosition = 0.0; 74 | } 75 | 76 | // Setup the page contol 77 | self.pageControl.currentPage = position; 78 | } 79 | 80 | - (void)scrollViewDidScroll:(UIScrollView *)sender 81 | { 82 | CGFloat newScrolledXPosition = self.scrollView.contentOffset.x; 83 | 84 | BOOL scrollRight = FALSE; 85 | BOOL scrollLeft = FALSE; 86 | CGFloat diff = 0; 87 | if (newScrolledXPosition > self.lastScrolledXPosition) { 88 | scrollRight = TRUE; 89 | diff = (newScrolledXPosition - self.lastScrolledXPosition); 90 | } else if (newScrolledXPosition < self.lastScrolledXPosition) { 91 | scrollLeft = TRUE; 92 | diff = (self.lastScrolledXPosition - newScrolledXPosition); 93 | } 94 | 95 | CGFloat ratio = diff / 320.0; 96 | if (ratio < 1.04) { 97 | ratio = 1.0; 98 | } 99 | NSInteger roundedRatio = ceil(ratio); 100 | 101 | BOOL shouldLoad = TRUE; 102 | if (diff > 0.0 && diff > (319.0 * roundedRatio)) { 103 | shouldLoad = FALSE; 104 | } 105 | 106 | if (shouldLoad || self.initialPosition >= 0) { 107 | self.initialPosition = -1; 108 | CGFloat pageWidth = self.scrollView.frame.size.width; 109 | float fractionalPage = (self.scrollView.contentOffset.x / pageWidth); 110 | 111 | NSInteger firstPageIndex = self.firstController.pageNumber; 112 | NSInteger secondPageIndex = self.secondController.pageNumber; 113 | 114 | NSInteger currentPageIndex = lround(fractionalPage); 115 | 116 | BOOL firstControllerUsed = TRUE; 117 | 118 | if (firstPageIndex == currentPageIndex) { 119 | // first controller used 120 | firstControllerUsed = TRUE; 121 | } else if (secondPageIndex == currentPageIndex) { 122 | // second controller used 123 | firstControllerUsed = FALSE; 124 | } else { 125 | // use first controller 126 | firstControllerUsed = FALSE; 127 | } 128 | 129 | NSInteger lowerNumber = floor(fractionalPage); 130 | NSInteger upperNumber = lowerNumber + 1; 131 | 132 | NSInteger nextPage = 0; 133 | NSInteger currentPage = 0; 134 | if (firstControllerUsed) { 135 | nextPage = self.secondController.view.frame.origin.x / 320.0; 136 | currentPage = self.firstController.view.frame.origin.x / 320.0; 137 | } else { 138 | nextPage = self.firstController.view.frame.origin.x / 320.0; 139 | currentPage = self.secondController.view.frame.origin.x / 320.0; 140 | } 141 | 142 | NSInteger currentIndexToUse = -1; 143 | NSInteger nextIndexToUse = -1; 144 | 145 | if (lowerNumber == currentPage) { 146 | if (upperNumber != nextPage) { 147 | nextIndexToUse = upperNumber; 148 | } 149 | } else if (upperNumber == currentPage) { 150 | if (lowerNumber != nextPage) { 151 | nextIndexToUse = lowerNumber; 152 | } 153 | } else { 154 | if (lowerNumber == nextPage) { 155 | currentIndexToUse = upperNumber; 156 | } else if (upperNumber == nextPage) { 157 | currentIndexToUse = lowerNumber; 158 | } else { 159 | currentIndexToUse = lowerNumber; 160 | nextIndexToUse = upperNumber; 161 | } 162 | } 163 | 164 | if (nextIndexToUse != -1) { 165 | DLog(@"nextIndexToUse: %d", nextIndexToUse); 166 | CGFloat yPosition = self.scrollView.frame.size.height; 167 | NSInteger pagesCount = [self.appDelegate.content count]; 168 | if (nextIndexToUse < pagesCount) { 169 | yPosition = 0.0; 170 | } 171 | if (firstControllerUsed) { 172 | self.secondController.pageNumber = nextIndexToUse; 173 | [self.secondController loadContent:self]; 174 | CGRect firstFrame = self.scrollView.frame; 175 | self.secondController.view.frame = CGRectMake(nextIndexToUse * firstFrame.size.width, yPosition, firstFrame.size.width, firstFrame.size.height); 176 | } else { 177 | self.firstController.pageNumber = nextIndexToUse; 178 | [self.firstController loadContent:self]; 179 | CGRect firstFrame = self.scrollView.frame; 180 | self.firstController.view.frame = CGRectMake(nextIndexToUse * firstFrame.size.width, yPosition, firstFrame.size.width, firstFrame.size.height); 181 | } 182 | } 183 | 184 | if (currentIndexToUse != -1) { 185 | DLog(@"currentIndexToUse: %d", currentIndexToUse); 186 | NSInteger count = [self.appDelegate.content count]; 187 | if (currentIndexToUse< count) { 188 | if (firstControllerUsed) { 189 | self.firstController.pageNumber = currentIndexToUse; 190 | [self.firstController loadContent:self]; 191 | CGRect firstFrame = self.scrollView.frame; 192 | self.firstController.view.frame = CGRectMake(currentIndexToUse * firstFrame.size.width, 0.0, firstFrame.size.width, firstFrame.size.height); 193 | } else { 194 | self.secondController.pageNumber = currentIndexToUse; 195 | [self.secondController loadContent:self]; 196 | CGRect firstFrame = self.scrollView.frame; 197 | self.secondController.view.frame = CGRectMake(currentIndexToUse * firstFrame.size.width, 0.0, firstFrame.size.width, firstFrame.size.height); 198 | } 199 | } 200 | } 201 | } 202 | } 203 | 204 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView 205 | { 206 | self.lastScrolledXPosition = self.scrollView.contentOffset.x; 207 | } 208 | 209 | - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)newScrollView 210 | { 211 | // CGFloat pageWidth = self.scrollView.frame.size.width; 212 | // float fractionalPage = self.scrollView.contentOffset.x / pageWidth; 213 | // NSInteger nearestNumber = lround(fractionalPage); 214 | // DLog(@"nearestNumber: %d", nearestNumber); 215 | } 216 | 217 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)newScrollView 218 | { 219 | [self scrollViewDidEndScrollingAnimation:newScrollView]; 220 | 221 | CGFloat pageWidth = self.scrollView.frame.size.width; 222 | float fractionalPage = self.scrollView.contentOffset.x / pageWidth; 223 | NSInteger nearestNumber = lround(fractionalPage); 224 | self.pageControl.currentPage = nearestNumber; 225 | 226 | [self.appDelegate.savedLocation replaceObjectAtIndex:0 withObject:[NSString stringWithFormat:@"%d", nearestNumber]]; 227 | } 228 | 229 | 230 | - (IBAction)loadPage:(id)sender 231 | { 232 | NSInteger index = self.pageControl.currentPage; 233 | [self.appDelegate.savedLocation replaceObjectAtIndex:0 withObject:[NSString stringWithFormat:@"%d", index]]; 234 | 235 | DLog(@"tapped index: %d", index); 236 | CGRect rectToScrollTo = CGRectMake(index * self.scrollView.frame.size.width, 0.0, self.scrollView.frame.size.width, self.scrollView.frame.size.height); 237 | 238 | self.lastScrolledXPosition = self.scrollView.contentOffset.x; 239 | [self.scrollView scrollRectToVisible:rectToScrollTo animated:TRUE]; 240 | 241 | [self.appDelegate.savedLocation replaceObjectAtIndex:0 withObject:[NSString stringWithFormat:@"%d", index]]; 242 | } 243 | 244 | /* 245 | // Override to allow orientations other than the default portrait orientation. 246 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 247 | // Return YES for supported orientations 248 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 249 | } 250 | */ 251 | 252 | #pragma mark - 253 | #pragma mark Memory Warning: 254 | 255 | - (void)didReceiveMemoryWarning { 256 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 257 | // Release anything that's not essential, such as cached data 258 | } 259 | 260 | 261 | - (void)dealloc { 262 | [_secondController release]; 263 | [_firstController release]; 264 | [_scrollView release]; 265 | [_pageControl release]; 266 | 267 | [super dealloc]; 268 | } 269 | 270 | 271 | @end 272 | -------------------------------------------------------------------------------- /MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 528 5 | 9G55 6 | 677 7 | 949.43 8 | 353.00 9 | 10 | YES 11 | 12 | 13 | 14 | YES 15 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 16 | 17 | 18 | YES 19 | 20 | YES 21 | 22 | 23 | YES 24 | 25 | 26 | 27 | YES 28 | 29 | IBFilesOwner 30 | 31 | 32 | IBFirstResponder 33 | 34 | 35 | 36 | 37 | 1316 38 | 39 | {320, 480} 40 | 41 | 1 42 | MSAxIDEAA 43 | 44 | NO 45 | NO 46 | 47 | 48 | 49 | 50 | 51 | 52 | 256 53 | {0, 0} 54 | NO 55 | YES 56 | YES 57 | 58 | 59 | YES 60 | 61 | 62 | 63 | Pages List 64 | 65 | 66 | PagesListController.m 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | YES 75 | 76 | 77 | delegate 78 | 79 | 80 | 81 | 4 82 | 83 | 84 | 85 | window 86 | 87 | 88 | 89 | 5 90 | 91 | 92 | 93 | navigationController 94 | 95 | 96 | 97 | 15 98 | 99 | 100 | 101 | 102 | YES 103 | 104 | 0 105 | 106 | YES 107 | 108 | 109 | 110 | 111 | 112 | 2 113 | 114 | 115 | YES 116 | 117 | 118 | 119 | 120 | -1 121 | 122 | 123 | RmlsZSdzIE93bmVyA 124 | 125 | 126 | 3 127 | 128 | 129 | 130 | 131 | -2 132 | 133 | 134 | 135 | 136 | 9 137 | 138 | 139 | YES 140 | 141 | 142 | 143 | 144 | 145 | 146 | 11 147 | 148 | 149 | 150 | 151 | 13 152 | 153 | 154 | YES 155 | 156 | 157 | 158 | 159 | 160 | 14 161 | 162 | 163 | 164 | 165 | 166 | 167 | YES 168 | 169 | YES 170 | -1.CustomClassName 171 | -2.CustomClassName 172 | 11.IBPluginDependency 173 | 13.CustomClassName 174 | 13.IBPluginDependency 175 | 2.IBAttributePlaceholdersKey 176 | 2.IBEditorWindowLastContentRect 177 | 2.IBPluginDependency 178 | 3.CustomClassName 179 | 3.IBPluginDependency 180 | 9.IBEditorWindowLastContentRect 181 | 9.IBPluginDependency 182 | 183 | 184 | YES 185 | UIApplication 186 | UIResponder 187 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 188 | PagesListController 189 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 190 | 191 | YES 192 | 193 | YES 194 | 195 | 196 | YES 197 | 198 | 199 | {{673, 376}, {320, 480}} 200 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 201 | PageScrollingAppDelegate 202 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 203 | {{-1091, 538}, {320, 480}} 204 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 205 | 206 | 207 | 208 | YES 209 | 210 | YES 211 | 212 | 213 | YES 214 | 215 | 216 | 217 | 218 | YES 219 | 220 | YES 221 | 222 | 223 | YES 224 | 225 | 226 | 227 | 16 228 | 229 | 230 | 231 | YES 232 | 233 | PageScrollingAppDelegate 234 | NSObject 235 | 236 | YES 237 | 238 | YES 239 | loadLastSavedLocation: 240 | loadUserDefaults: 241 | 242 | 243 | YES 244 | id 245 | id 246 | 247 | 248 | 249 | YES 250 | 251 | YES 252 | navigationController 253 | window 254 | 255 | 256 | YES 257 | UINavigationController 258 | UIWindow 259 | 260 | 261 | 262 | IBProjectSource 263 | Classes/PageScrollingAppDelegate.h 264 | 265 | 266 | 267 | PagesListController 268 | UITableViewController 269 | 270 | YES 271 | 272 | YES 273 | loadAppDelegate: 274 | loadTableContent: 275 | 276 | 277 | YES 278 | id 279 | id 280 | 281 | 282 | 283 | IBProjectSource 284 | Classes/PagesListController.h 285 | 286 | 287 | 288 | 289 | 0 290 | PageScrolling.xcodeproj 291 | 3 292 | 293 | 294 | -------------------------------------------------------------------------------- /PageScrollContainer.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 528 5 | 9G55 6 | 677 7 | 949.43 8 | 353.00 9 | 10 | YES 11 | 12 | 13 | 14 | 15 | 16 | YES 17 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 18 | 19 | 20 | YES 21 | 22 | YES 23 | 24 | 25 | YES 26 | 27 | 28 | 29 | YES 30 | 31 | IBFilesOwner 32 | 33 | 34 | IBFirstResponder 35 | 36 | 37 | 38 | 292 39 | 40 | YES 41 | 42 | 43 | 268 44 | {320, 416} 45 | 46 | YES 47 | YES 48 | YES 49 | YES 50 | YES 51 | NO 52 | NO 53 | NO 54 | 55 | 56 | 57 | 1316 58 | 59 | {{0, 360}, {320, 36}} 60 | 61 | NO 62 | YES 63 | YES 64 | 0 65 | 0 66 | 3 67 | 68 | 69 | {320, 416} 70 | 71 | 72 | 1 73 | MCAwLjUwMTk2MDgxIDEAA 74 | 75 | 76 | 77 | PageController 78 | 79 | 80 | 81 | PageController 82 | 83 | 84 | 85 | 86 | 87 | YES 88 | 89 | 90 | view 91 | 92 | 93 | 94 | 3 95 | 96 | 97 | 98 | pageControl 99 | 100 | 101 | 102 | 5 103 | 104 | 105 | 106 | firstController 107 | 108 | 109 | 110 | 9 111 | 112 | 113 | 114 | secondController 115 | 116 | 117 | 118 | 10 119 | 120 | 121 | 122 | scrollView 123 | 124 | 125 | 126 | 11 127 | 128 | 129 | 130 | loadPage: 131 | 132 | 133 | 13 134 | 135 | 12 136 | 137 | 138 | 139 | delegate 140 | 141 | 142 | 143 | 13 144 | 145 | 146 | 147 | 148 | YES 149 | 150 | 0 151 | 152 | YES 153 | 154 | 155 | 156 | 157 | 158 | 1 159 | 160 | 161 | YES 162 | 163 | 164 | 165 | 166 | 167 | 168 | -1 169 | 170 | 171 | RmlsZSdzIE93bmVyA 172 | 173 | 174 | -2 175 | 176 | 177 | 178 | 179 | 4 180 | 181 | 182 | 183 | 184 | 6 185 | 186 | 187 | 188 | 189 | 7 190 | 191 | 192 | 193 | 194 | 8 195 | 196 | 197 | 198 | 199 | 200 | 201 | YES 202 | 203 | YES 204 | -1.CustomClassName 205 | -2.CustomClassName 206 | 1.IBEditorWindowLastContentRect 207 | 1.IBPluginDependency 208 | 4.IBPluginDependency 209 | 6.IBPluginDependency 210 | 7.CustomClassName 211 | 7.IBEditorWindowLastContentRect 212 | 7.IBPluginDependency 213 | 8.CustomClassName 214 | 8.IBEditorWindowLastContentRect 215 | 8.IBPluginDependency 216 | 217 | 218 | YES 219 | PageScrollContainer 220 | UIResponder 221 | {{330, 279}, {320, 416}} 222 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 223 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 224 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 225 | PageController 226 | {{-985, 18}, {320, 480}} 227 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 228 | PageController 229 | {{-704, 537}, {320, 480}} 230 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 231 | 232 | 233 | 234 | YES 235 | 236 | YES 237 | 238 | 239 | YES 240 | 241 | 242 | 243 | 244 | YES 245 | 246 | YES 247 | 248 | 249 | YES 250 | 251 | 252 | 253 | 13 254 | 255 | 256 | 257 | YES 258 | 259 | BaseViewController 260 | UIViewController 261 | 262 | loadAppDelegate: 263 | id 264 | 265 | 266 | IBProjectSource 267 | Classes/BaseViewController.h 268 | 269 | 270 | 271 | PageController 272 | BaseViewController 273 | 274 | loadContent: 275 | id 276 | 277 | 278 | label 279 | UILabel 280 | 281 | 282 | IBProjectSource 283 | Classes/PageController.h 284 | 285 | 286 | 287 | PageScrollContainer 288 | BaseViewController 289 | 290 | loadPage: 291 | id 292 | 293 | 294 | YES 295 | 296 | YES 297 | firstController 298 | pageControl 299 | scrollView 300 | secondController 301 | 302 | 303 | YES 304 | PageController 305 | UIPageControl 306 | UIScrollView 307 | PageController 308 | 309 | 310 | 311 | IBProjectSource 312 | Classes/PageScrollContainer.h 313 | 314 | 315 | 316 | 317 | 0 318 | PageScrolling.xcodeproj 319 | 3 320 | 321 | 322 | -------------------------------------------------------------------------------- /PageScrolling.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* PageScrollingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* PageScrollingAppDelegate.m */; }; 11 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 12 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 13 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 14 | 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; }; 15 | 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; }; 16 | 3AC375330F773AA0009CF124 /* PagesListController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AC375320F773AA0009CF124 /* PagesListController.m */; }; 17 | 3AC375F90F77457F009CF124 /* PagesListController.m.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AC375F80F77457F009CF124 /* PagesListController.m.xib */; }; 18 | 3AF452A90F77477F0082C5AF /* PageController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AF452A80F77477F0082C5AF /* PageController.m */; }; 19 | 3AF452AC0F77486A0082C5AF /* PageController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AF452AB0F77486A0082C5AF /* PageController.xib */; }; 20 | 3AF453130F774EEC0082C5AF /* PageScrollContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AF453120F774EEC0082C5AF /* PageScrollContainer.m */; }; 21 | 3AF453150F774F040082C5AF /* PageScrollContainer.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AF453140F774F040082C5AF /* PageScrollContainer.xib */; }; 22 | 3AF453660F7752460082C5AF /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AF453650F7752460082C5AF /* BaseViewController.m */; }; 23 | 3AF4536B0F7752580082C5AF /* BaseTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AF4536A0F7752580082C5AF /* BaseTableViewController.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 28 | 1D3623240D0F684500981E51 /* PageScrollingAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageScrollingAppDelegate.h; sourceTree = ""; }; 29 | 1D3623250D0F684500981E51 /* PageScrollingAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PageScrollingAppDelegate.m; sourceTree = ""; }; 30 | 1D6058910D05DD3D006BFB54 /* PageScrolling.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PageScrolling.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 32 | 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 33 | 28A0AAE50D9B0CCF005BE974 /* PageScrolling_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageScrolling_Prefix.pch; sourceTree = ""; }; 34 | 28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 35 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 36 | 3AC375310F773AA0009CF124 /* PagesListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PagesListController.h; sourceTree = ""; }; 37 | 3AC375320F773AA0009CF124 /* PagesListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PagesListController.m; sourceTree = ""; }; 38 | 3AC3756A0F773C97009CF124 /* Define.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Define.h; path = Classes/Define.h; sourceTree = ""; }; 39 | 3AC375F80F77457F009CF124 /* PagesListController.m.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PagesListController.m.xib; sourceTree = ""; }; 40 | 3AF452A70F77477F0082C5AF /* PageController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageController.h; sourceTree = ""; }; 41 | 3AF452A80F77477F0082C5AF /* PageController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PageController.m; sourceTree = ""; }; 42 | 3AF452AB0F77486A0082C5AF /* PageController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PageController.xib; sourceTree = ""; }; 43 | 3AF453110F774EEC0082C5AF /* PageScrollContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageScrollContainer.h; sourceTree = ""; }; 44 | 3AF453120F774EEC0082C5AF /* PageScrollContainer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PageScrollContainer.m; sourceTree = ""; }; 45 | 3AF453140F774F040082C5AF /* PageScrollContainer.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PageScrollContainer.xib; sourceTree = ""; }; 46 | 3AF453640F7752460082C5AF /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = ""; }; 47 | 3AF453650F7752460082C5AF /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = ""; }; 48 | 3AF453690F7752580082C5AF /* BaseTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseTableViewController.h; sourceTree = ""; }; 49 | 3AF4536A0F7752580082C5AF /* BaseTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseTableViewController.m; sourceTree = ""; }; 50 | 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 59 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 60 | 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | 080E96DDFE201D6D7F000001 /* Classes */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 1D3623240D0F684500981E51 /* PageScrollingAppDelegate.h */, 71 | 1D3623250D0F684500981E51 /* PageScrollingAppDelegate.m */, 72 | 3AC375400F773BE5009CF124 /* Controllers */, 73 | ); 74 | path = Classes; 75 | sourceTree = ""; 76 | }; 77 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 1D6058910D05DD3D006BFB54 /* PageScrolling.app */, 81 | ); 82 | name = Products; 83 | sourceTree = ""; 84 | }; 85 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 3AC3756A0F773C97009CF124 /* Define.h */, 89 | 080E96DDFE201D6D7F000001 /* Classes */, 90 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 91 | 29B97317FDCFA39411CA2CEA /* Resources */, 92 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 93 | 19C28FACFE9D520D11CA2CBB /* Products */, 94 | ); 95 | name = CustomTemplate; 96 | sourceTree = ""; 97 | }; 98 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 28A0AAE50D9B0CCF005BE974 /* PageScrolling_Prefix.pch */, 102 | 29B97316FDCFA39411CA2CEA /* main.m */, 103 | ); 104 | name = "Other Sources"; 105 | sourceTree = ""; 106 | }; 107 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 28AD735F0D9D9599002E5188 /* MainWindow.xib */, 111 | 3AC375F80F77457F009CF124 /* PagesListController.m.xib */, 112 | 3AF452AB0F77486A0082C5AF /* PageController.xib */, 113 | 3AF453140F774F040082C5AF /* PageScrollContainer.xib */, 114 | 8D1107310486CEB800E47090 /* Info.plist */, 115 | ); 116 | name = Resources; 117 | sourceTree = ""; 118 | }; 119 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 123 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 124 | 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, 125 | ); 126 | name = Frameworks; 127 | sourceTree = ""; 128 | }; 129 | 3AC375400F773BE5009CF124 /* Controllers */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 3AF453630F7752330082C5AF /* Base */, 133 | 3AC375310F773AA0009CF124 /* PagesListController.h */, 134 | 3AC375320F773AA0009CF124 /* PagesListController.m */, 135 | 3AF452A70F77477F0082C5AF /* PageController.h */, 136 | 3AF452A80F77477F0082C5AF /* PageController.m */, 137 | 3AF453110F774EEC0082C5AF /* PageScrollContainer.h */, 138 | 3AF453120F774EEC0082C5AF /* PageScrollContainer.m */, 139 | ); 140 | name = Controllers; 141 | sourceTree = ""; 142 | }; 143 | 3AF453630F7752330082C5AF /* Base */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 3AF453640F7752460082C5AF /* BaseViewController.h */, 147 | 3AF453650F7752460082C5AF /* BaseViewController.m */, 148 | 3AF453690F7752580082C5AF /* BaseTableViewController.h */, 149 | 3AF4536A0F7752580082C5AF /* BaseTableViewController.m */, 150 | ); 151 | name = Base; 152 | sourceTree = ""; 153 | }; 154 | /* End PBXGroup section */ 155 | 156 | /* Begin PBXNativeTarget section */ 157 | 1D6058900D05DD3D006BFB54 /* PageScrolling */ = { 158 | isa = PBXNativeTarget; 159 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PageScrolling" */; 160 | buildPhases = ( 161 | 1D60588D0D05DD3D006BFB54 /* Resources */, 162 | 1D60588E0D05DD3D006BFB54 /* Sources */, 163 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 164 | ); 165 | buildRules = ( 166 | ); 167 | dependencies = ( 168 | ); 169 | name = PageScrolling; 170 | productName = PageScrolling; 171 | productReference = 1D6058910D05DD3D006BFB54 /* PageScrolling.app */; 172 | productType = "com.apple.product-type.application"; 173 | }; 174 | /* End PBXNativeTarget section */ 175 | 176 | /* Begin PBXProject section */ 177 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 178 | isa = PBXProject; 179 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PageScrolling" */; 180 | compatibilityVersion = "Xcode 3.1"; 181 | hasScannedForEncodings = 1; 182 | knownRegions = ( 183 | English, 184 | Japanese, 185 | French, 186 | German, 187 | en, 188 | ); 189 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 190 | projectDirPath = ""; 191 | projectRoot = ""; 192 | targets = ( 193 | 1D6058900D05DD3D006BFB54 /* PageScrolling */, 194 | ); 195 | }; 196 | /* End PBXProject section */ 197 | 198 | /* Begin PBXResourcesBuildPhase section */ 199 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 200 | isa = PBXResourcesBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */, 204 | 3AC375F90F77457F009CF124 /* PagesListController.m.xib in Resources */, 205 | 3AF452AC0F77486A0082C5AF /* PageController.xib in Resources */, 206 | 3AF453150F774F040082C5AF /* PageScrollContainer.xib in Resources */, 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | }; 210 | /* End PBXResourcesBuildPhase section */ 211 | 212 | /* Begin PBXSourcesBuildPhase section */ 213 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 214 | isa = PBXSourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 218 | 1D3623260D0F684500981E51 /* PageScrollingAppDelegate.m in Sources */, 219 | 3AC375330F773AA0009CF124 /* PagesListController.m in Sources */, 220 | 3AF452A90F77477F0082C5AF /* PageController.m in Sources */, 221 | 3AF453130F774EEC0082C5AF /* PageScrollContainer.m in Sources */, 222 | 3AF453660F7752460082C5AF /* BaseViewController.m in Sources */, 223 | 3AF4536B0F7752580082C5AF /* BaseTableViewController.m in Sources */, 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | }; 227 | /* End PBXSourcesBuildPhase section */ 228 | 229 | /* Begin XCBuildConfiguration section */ 230 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 231 | isa = XCBuildConfiguration; 232 | buildSettings = { 233 | ALWAYS_SEARCH_USER_PATHS = NO; 234 | COPY_PHASE_STRIP = NO; 235 | GCC_DYNAMIC_NO_PIC = NO; 236 | GCC_OPTIMIZATION_LEVEL = 0; 237 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 238 | GCC_PREFIX_HEADER = PageScrolling_Prefix.pch; 239 | INFOPLIST_FILE = Info.plist; 240 | OTHER_CFLAGS = "-DDEBUG"; 241 | PRODUCT_NAME = PageScrolling; 242 | }; 243 | name = Debug; 244 | }; 245 | 1D6058950D05DD3E006BFB54 /* Release */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ALWAYS_SEARCH_USER_PATHS = NO; 249 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Anthony Mittaz"; 250 | COPY_PHASE_STRIP = YES; 251 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 252 | GCC_PREFIX_HEADER = PageScrolling_Prefix.pch; 253 | INFOPLIST_FILE = Info.plist; 254 | PRODUCT_NAME = PageScrolling; 255 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = "A9554902-2B02-4516-86D0-9AB271E8CEFD"; 256 | }; 257 | name = Release; 258 | }; 259 | C01FCF4F08A954540054247B /* Debug */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 263 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Anthony Mittaz"; 264 | GCC_C_LANGUAGE_STANDARD = c99; 265 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 266 | GCC_WARN_UNUSED_VARIABLE = YES; 267 | ONLY_ACTIVE_ARCH = YES; 268 | PREBINDING = NO; 269 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = "27E92BD4-9181-443A-A01B-A30C67A7A410"; 270 | SDKROOT = iphoneos2.2.1; 271 | }; 272 | name = Debug; 273 | }; 274 | C01FCF5008A954540054247B /* Release */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 278 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Anthony Mittaz"; 279 | GCC_C_LANGUAGE_STANDARD = c99; 280 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 281 | GCC_WARN_UNUSED_VARIABLE = YES; 282 | PREBINDING = NO; 283 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = "A9554902-2B02-4516-86D0-9AB271E8CEFD"; 284 | SDKROOT = iphoneos2.2.1; 285 | }; 286 | name = Release; 287 | }; 288 | /* End XCBuildConfiguration section */ 289 | 290 | /* Begin XCConfigurationList section */ 291 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PageScrolling" */ = { 292 | isa = XCConfigurationList; 293 | buildConfigurations = ( 294 | 1D6058940D05DD3E006BFB54 /* Debug */, 295 | 1D6058950D05DD3E006BFB54 /* Release */, 296 | ); 297 | defaultConfigurationIsVisible = 0; 298 | defaultConfigurationName = Release; 299 | }; 300 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PageScrolling" */ = { 301 | isa = XCConfigurationList; 302 | buildConfigurations = ( 303 | C01FCF4F08A954540054247B /* Debug */, 304 | C01FCF5008A954540054247B /* Release */, 305 | ); 306 | defaultConfigurationIsVisible = 0; 307 | defaultConfigurationName = Release; 308 | }; 309 | /* End XCConfigurationList section */ 310 | }; 311 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 312 | } 313 | --------------------------------------------------------------------------------