From 67d601edbb9a8ea25f955f3ff043fa26083d93ce Mon Sep 17 00:00:00 2001 From: "Dio.Zhou" Date: Tue, 20 Nov 2012 00:27:22 +0800 Subject: [PATCH 1/3] Change ATPagingview to ARC project --- .gitignore | 9 +- ATPagingView/ATPagingView.h | 10 +- ATPagingView/ATPagingView.m | 136 +++++++++++++----- .../project.pbxproj | 2 + .../contents.xcworkspacedata | 7 + .../UserInterfaceState.xcuserstate | Bin 0 -> 12735 bytes .../WorkspaceSettings.xcsettings | 10 ++ .../xcschemes/ATPagingViewDemo.xcscheme | 86 +++++++++++ .../xcschemes/xcschememanagement.plist | 22 +++ .../Classes/ATPagingViewDemoAppDelegate.h | 4 +- .../Classes/ATPagingViewDemoAppDelegate.m | 4 - .../ATPagingViewDemo/Classes/DemoPageView.m | 3 - .../Classes/DemoViewController.m | 3 +- ATPagingView/ATPagingViewDemo/main.m | 8 +- 14 files changed, 246 insertions(+), 58 deletions(-) create mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dio.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dio.xcuserdatad/WorkspaceSettings.xcsettings create mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/ATPagingViewDemo.xcscheme create mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/.gitignore b/.gitignore index 5f8982c..2fa7514 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -*.o -*.mode1v3 +*.xcworkspace *.pbxuser *.perspectivev3 -ATPagingView/ATPagingViewDemo/build -ATArrayView/ATArrayViewDemo/build +*.mode1v3 +xcuserdata +.DS_Store +.svn diff --git a/ATPagingView/ATPagingView.h b/ATPagingView/ATPagingView.h index 13c32b5..984e2cf 100644 --- a/ATPagingView/ATPagingView.h +++ b/ATPagingView/ATPagingView.h @@ -8,13 +8,13 @@ @protocol ATPagingViewDelegate; -// a wrapper around UIScrollView in (horizontal) paging mode, with an API similar to UITableView +// a wrapper around UIScrollView in paging mode, with an API similar to UITableView @interface ATPagingView : UIView { // subviews UIScrollView *_scrollView; // properties - id _delegate; + id __weak _delegate; CGFloat _gapBetweenPages; NSInteger _pagesToPreload; @@ -31,9 +31,10 @@ BOOL _rotationInProgress; BOOL _scrollViewIsMoving; BOOL _recyclingEnabled; + BOOL _horizontal; } -@property(nonatomic, assign) IBOutlet id delegate; +@property(nonatomic, weak) IBOutlet id delegate; @property(nonatomic, assign) CGFloat gapBetweenPages; // default is 20 @@ -52,6 +53,7 @@ @property(nonatomic, assign, readonly) BOOL moving; @property(nonatomic, assign) BOOL recyclingEnabled; +@property(nonatomic, assign) BOOL horizontal; // default YES - (void)reloadData; // must be called at least once to display something @@ -91,6 +93,6 @@ ATPagingView *_pagingView; } -@property(nonatomic, retain) IBOutlet ATPagingView *pagingView; +@property(nonatomic, strong) IBOutlet ATPagingView *pagingView; @end diff --git a/ATPagingView/ATPagingView.m b/ATPagingView/ATPagingView.m index 38a2eb4..c79c12f 100644 --- a/ATPagingView/ATPagingView.m +++ b/ATPagingView/ATPagingView.m @@ -39,6 +39,7 @@ @implementation ATPagingView @synthesize moving=_scrollViewIsMoving; @synthesize previousPageIndex=_previousPageIndex; @synthesize recyclingEnabled=_recyclingEnabled; +@synthesize horizontal=_horizontal; #pragma mark - @@ -52,6 +53,7 @@ - (void)commonInit { _pagesToPreload = 1; _recyclingEnabled = YES; _firstLoadedPageIndex = _lastLoadedPageIndex = -1; + _horizontal = YES; // We are using an oversized UIScrollView to implement interpage gaps, // and we need it to clipped on the sides. This is important when @@ -61,7 +63,7 @@ - (void)commonInit { _scrollView = [[UIScrollView alloc] initWithFrame:[self frameForScrollView]]; _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; _scrollView.pagingEnabled = YES; - _scrollView.backgroundColor = [UIColor blackColor]; + _scrollView.backgroundColor = [UIColor clearColor]; _scrollView.showsVerticalScrollIndicator = NO; _scrollView.showsHorizontalScrollIndicator = NO; _scrollView.bounces = YES; @@ -84,11 +86,10 @@ - (id)initWithFrame:(CGRect)frame { } - (void)dealloc { - [_scrollView release], _scrollView = nil; + _scrollView = nil; _delegate = nil; - [_recycledPages release], _recycledPages = nil; - [_visiblePages release], _visiblePages = nil; - [super dealloc]; + _recycledPages = nil; + _visiblePages = nil; } @@ -100,10 +101,21 @@ - (void)setGapBetweenPages:(CGFloat)value { } - (void)setPagesToPreload:(NSInteger)value { + BOOL reconfigure = _pagesToPreload != value; _pagesToPreload = value; - [self configurePages]; + if (reconfigure) { + [self configurePages]; + } } +-(void)setHorizontal:(BOOL)value { + BOOL reconfigure = _horizontal != value; + _horizontal = value; + if (reconfigure) { + [self layoutIfNeeded]; // force call to layoutSubview to set _scrollView.frame + [self configurePages]; + } +} #pragma mark - #pragma mark Data @@ -132,8 +144,11 @@ - (UIView *)viewForPageAtIndex:(NSUInteger)index { } - (void)configurePages { - if (_scrollView.frame.size.width <= _gapBetweenPages + 1e-6) + if (_horizontal && (_scrollView.frame.size.width <= _gapBetweenPages + 1e-6)) { + return; // not our time yet + } else if (_scrollView.frame.size.height <= _gapBetweenPages + 1e-6) { return; // not our time yet + } if (_pageCount == 0 && _currentPageIndex > 0) return; // still not our time @@ -144,14 +159,24 @@ - (void)configurePages { // to avoid hiccups while scrolling, do not preload invisible pages temporarily BOOL quickMode = (_scrollViewIsMoving && _pagesToPreload > 0); - CGSize contentSize = CGSizeMake(_scrollView.frame.size.width * _pageCount, _scrollView.frame.size.height); + CGSize contentSize; + if (_horizontal) { + contentSize = CGSizeMake(_scrollView.frame.size.width * _pageCount, _scrollView.frame.size.height); + } else { + contentSize = CGSizeMake(_scrollView.frame.size.width, _scrollView.frame.size.height * _pageCount); + } + if (!CGSizeEqualToSize(_scrollView.contentSize, contentSize)) { #ifdef AT_PAGING_VIEW_TRACE_LAYOUT NSLog(@"configurePages: _scrollView.frame == %@, setting _scrollView.contentSize = %@", NSStringFromCGRect(_scrollView.frame), NSStringFromCGSize(contentSize)); #endif _scrollView.contentSize = contentSize; - _scrollView.contentOffset = CGPointMake(_scrollView.frame.size.width * _currentPageIndex, 0); + if (_horizontal) { + _scrollView.contentOffset = CGPointMake(_scrollView.frame.size.width * _currentPageIndex, 0); + } else { + _scrollView.contentOffset = CGPointMake(0, _scrollView.frame.size.height * _currentPageIndex); + } } else { #ifdef AT_PAGING_VIEW_TRACE_LAYOUT NSLog(@"configurePages: _scrollView.frame == %@", NSStringFromCGRect(_scrollView.frame)); @@ -159,7 +184,12 @@ - (void)configurePages { } CGRect visibleBounds = _scrollView.bounds; - NSInteger newPageIndex = MIN(MAX(floorf(CGRectGetMidX(visibleBounds) / CGRectGetWidth(visibleBounds)), 0), _pageCount - 1); + NSInteger newPageIndex; + if (_horizontal) { + newPageIndex = MIN(MAX(floorf(CGRectGetMidX(visibleBounds) / CGRectGetWidth(visibleBounds)), 0), _pageCount - 1); + } else { + newPageIndex = MIN(MAX(floorf(CGRectGetMidY(visibleBounds) / CGRectGetHeight(visibleBounds)), 0), _pageCount - 1); + } #ifdef AT_PAGING_VIEW_TRACE_LAYOUT NSLog(@"newPageIndex == %d", newPageIndex); #endif @@ -279,7 +309,11 @@ - (void)willAnimateRotation { // // So we set the new size, but keep the old position here. CGSize pageSize = _scrollView.frame.size; - [self viewForPageAtIndex:_currentPageIndex].frame = CGRectMake(_scrollView.contentOffset.x + _gapBetweenPages/2, 0, pageSize.width - _gapBetweenPages, pageSize.height); + if (_horizontal) { + [self viewForPageAtIndex:_currentPageIndex].frame = CGRectMake(_scrollView.contentOffset.x + _gapBetweenPages/2, 0, pageSize.width - _gapBetweenPages, pageSize.height); + } else { + [self viewForPageAtIndex:_currentPageIndex].frame = CGRectMake(0, _scrollView.contentOffset.y + _gapBetweenPages/2, pageSize.width, pageSize.height - _gapBetweenPages); + } } - (void)didRotate { @@ -287,7 +321,12 @@ - (void)didRotate { // changes, because we move the pages and adjust contentOffset simultaneously. for (UIView *view in _visiblePages) [self configurePage:view forIndex:view.tag]; - _scrollView.contentOffset = CGPointMake(_currentPageIndex * _scrollView.frame.size.width, 0); + + if (_horizontal) { + _scrollView.contentOffset = CGPointMake(_currentPageIndex * _scrollView.frame.size.width, 0); + } else { + _scrollView.contentOffset = CGPointMake(0, _currentPageIndex * _scrollView.frame.size.height); + } _rotationInProgress = NO; @@ -302,9 +341,18 @@ - (void)setCurrentPageIndex:(NSInteger)newPageIndex { #ifdef AT_PAGING_VIEW_TRACE_LAYOUT NSLog(@"setCurrentPageIndex(%d): _scrollView.frame == %@", newPageIndex, NSStringFromCGRect(_scrollView.frame)); #endif - if (_scrollView.frame.size.width > 0 && fabsf(_scrollView.frame.origin.x - (-_gapBetweenPages/2)) < 1e-6) { - _scrollView.contentOffset = CGPointMake(_scrollView.frame.size.width * newPageIndex, 0); + if (_horizontal && (_scrollView.frame.size.width > 0 && fabsf(_scrollView.frame.origin.x - (-_gapBetweenPages/2)) < 1e-6) ) { + [UIView animateWithDuration:0.3 + animations:^{ + _scrollView.contentOffset = CGPointMake(_scrollView.frame.size.width * newPageIndex, 0); + }]; + } else if (_scrollView.frame.size.height > 0 && fabsf(_scrollView.frame.origin.y - (-_gapBetweenPages/2)) < 1e-6) { + [UIView animateWithDuration:0.3 + animations:^{ + _scrollView.contentOffset = CGPointMake(0, _scrollView.frame.size.height * newPageIndex); + }]; } + _currentPageIndex = newPageIndex; } @@ -324,23 +372,40 @@ - (void)layoutSubviews { _scrollView.frame = newFrame; } - if (oldFrame.size.width != 0 && _scrollView.frame.size.width != oldFrame.size.width) { - // rotation is in progress, don't do any adjustments just yet - } else if (oldFrame.size.height != _scrollView.frame.size.height) { - // some other height change (the initial change from 0 to some specific size, - // or maybe an in-call status bar has appeared or disappeared) - [self configurePages]; + if (_horizontal) { + if (oldFrame.size.width != 0 && _scrollView.frame.size.width != oldFrame.size.width) { + // rotation is in progress, don't do any adjustments just yet + } else if (oldFrame.size.height != _scrollView.frame.size.height) { + // some other height change (the initial change from 0 to some specific size, + // or maybe an in-call status bar has appeared or disappeared) + [self configurePages]; + } + } else { + if (oldFrame.size.height != 0 && _scrollView.frame.size.height != oldFrame.size.height) { + // rotation is in progress, don't do any adjustments just yet + } else if (oldFrame.size.width != _scrollView.frame.size.width) { + // some other width change ? + [self configurePages]; + } } } - (NSInteger)firstVisiblePageIndex { CGRect visibleBounds = _scrollView.bounds; - return MAX(floorf(CGRectGetMinX(visibleBounds) / CGRectGetWidth(visibleBounds)), 0); + if (_horizontal) { + return MAX(floorf(CGRectGetMinX(visibleBounds) / CGRectGetWidth(visibleBounds)), 0); + } else { + return MAX(floorf(CGRectGetMinY(visibleBounds) / CGRectGetHeight(visibleBounds)), 0); + } } - (NSInteger)lastVisiblePageIndex { CGRect visibleBounds = _scrollView.bounds; - return MIN(floorf((CGRectGetMaxX(visibleBounds)-1) / CGRectGetWidth(visibleBounds)), _pageCount - 1); + if (_horizontal) { + return MIN(floorf((CGRectGetMaxX(visibleBounds)-1) / CGRectGetWidth(visibleBounds)), _pageCount - 1); + } else { + return MIN(floorf((CGRectGetMaxY(visibleBounds)-1) / CGRectGetHeight(visibleBounds)), _pageCount - 1); + } } - (NSInteger)firstLoadedPageIndex { @@ -353,16 +418,24 @@ - (NSInteger)lastLoadedPageIndex { - (CGRect)frameForScrollView { CGSize size = self.bounds.size; - return CGRectMake(-_gapBetweenPages/2, 0, size.width + _gapBetweenPages, size.height); + if (_horizontal) { + return CGRectMake(-_gapBetweenPages/2, 0, size.width + _gapBetweenPages, size.height); + } else { + return CGRectMake(0, -_gapBetweenPages/2, size.width, size.height + _gapBetweenPages); + } } // not public because this is in scroll view coordinates - (CGRect)frameForPageAtIndex:(NSUInteger)index { CGFloat pageWidthWithGap = _scrollView.frame.size.width; + CGFloat pageHeightWithGap = _scrollView.frame.size.height; CGSize pageSize = self.bounds.size; - return CGRectMake(pageWidthWithGap * index + _gapBetweenPages/2, - 0, pageSize.width, pageSize.height); + if (_horizontal) { + return CGRectMake(pageWidthWithGap * index + _gapBetweenPages/2, 0, pageSize.width, pageSize.height); + } else { + return CGRectMake(0, pageHeightWithGap * index + _gapBetweenPages/2, pageSize.width, pageSize.height); + } } @@ -388,7 +461,7 @@ - (void)recyclePage:(UIView *)page { - (UIView *)dequeueReusablePage { UIView *result = [_recycledPages anyObject]; if (result) { - [_recycledPages removeObject:[[result retain] autorelease]]; + [_recycledPages removeObject:result]; } return result; } @@ -456,20 +529,11 @@ @implementation ATPagingViewController @synthesize pagingView=_pagingView; -#pragma mark - -#pragma mark init/dealloc - -- (void)dealloc { - [_pagingView release], _pagingView = nil; - [super dealloc]; -} - - #pragma mark - #pragma mark View Loading - (void)loadView { - self.view = self.pagingView = [[[ATPagingView alloc] init] autorelease]; + self.view = self.pagingView = [[ATPagingView alloc] init]; } - (void)viewDidLoad { diff --git a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.pbxproj b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.pbxproj index b5cc010..93b79c1 100755 --- a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.pbxproj +++ b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.pbxproj @@ -197,6 +197,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -211,6 +212,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ATPagingViewDemo_Prefix.pch; diff --git a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..80d1d14 --- /dev/null +++ b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dio.xcuserdatad/UserInterfaceState.xcuserstate b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dio.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..353dc148428f7e3bfecddcfb49e940d307137dfc GIT binary patch literal 12735 zcmc(F34Bw<*7z(3}l-IAthv)v?3p`|U|LAFv51Panp3I$`@TuLNON|LgQZ{mU? z4?)1~DN0**7u>}SQQ@h$10pK!8@RBlxFP>@bDOpi^!fij-|u5da_`KXbLPz1&os7r z+<{<0!G44hK@`Ox8H%Of&~NK4a|M6E?eo@Ke2te0O~Jrai__mU%MGtnHe(5>h;)Q&cwjp%;#0D2HTgq}t_&@*T!dKSHa zUPLdUH_=|S5A8>9p%2kV=wtK=I)YB2@6h+?2Xq?!h!|k{OcjEPU1Kx-?;k)s@_&&S~@5cYeFW?vPOLz}{8NY&G#joK{ z@Td4Q{5k#te~Ay{Bls(P68}nKNgU}zl1MU96D`RgSwv4P#7=TaAt@mhWH1>)s>nrT zESXH|$P`jfrV}smkybK?_(^~SNgJ6$$R7wd7pehz93(c!{i%slAIzxQbaK&G@dGH z0!^kGYM@4HqB*oLEv6;3l$Oyk^ddTzj-%sgHJv~w(u?U7T2C*b4(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Q zrX!}KrsJlQrti$y9BY=F@+u-XPGZEd(2+*Li1JT zmF64GtITW6?dJ97jpi-pyUq8SpEd6>zixihywCiW`4jV(<|F2>&Bx6r&EJ`S;1RFj z)x3_+;tjloxAAtqFMk0)lApv+=BMz}`04y5d^7Liy?iV0=l{W9%`f4vM_xShu5BZPz!~9qLxBPMbq$SOgV;N(qvj~=E zi`z2W(qi#h=2(K3t1L?_*IBN&EVrz%tg_r>xy7>4^0MVCE4Es#W!9P2#n$Vs%dIP| ztF1R%Z?$fp|=1)^DuGtS7DCS%0zqX2Z4^TdXb7rm|()3^udP zYO~w=+RAJLZG&yYY$I$VZIf)1ZBuO1Y%^>Qo5$v}&9Mb-^K1)jOKeMR|Fo^Jt+K7L zwc9#uowg0O7j19Z4%@!A9krdXeP=su``LCT8)egMb#{8TE?b{%%I33e**V$$vioNj zWRK0BmhH{HGW*8tE!j_Jzmt8`F0&`vRrX}N&ThBo+e_?2>_hF9_ObSH_G^XgNa&roEigU_xDssl + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/ATPagingViewDemo.xcscheme b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/ATPagingViewDemo.xcscheme new file mode 100644 index 0000000..3e48b88 --- /dev/null +++ b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/ATPagingViewDemo.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/xcschememanagement.plist b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..9c0976d --- /dev/null +++ b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + ATPagingViewDemo.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 1D6058900D05DD3D006BFB54 + + primary + + + + + diff --git a/ATPagingView/ATPagingViewDemo/Classes/ATPagingViewDemoAppDelegate.h b/ATPagingView/ATPagingViewDemo/Classes/ATPagingViewDemoAppDelegate.h index cd2ef72..386c1d3 100644 --- a/ATPagingView/ATPagingViewDemo/Classes/ATPagingViewDemoAppDelegate.h +++ b/ATPagingView/ATPagingViewDemo/Classes/ATPagingViewDemoAppDelegate.h @@ -9,8 +9,8 @@ UINavigationController *navigationController; } -@property (nonatomic, retain) IBOutlet UIWindow *window; -@property (nonatomic, retain) IBOutlet UINavigationController *navigationController; +@property (nonatomic, strong) IBOutlet UIWindow *window; +@property (nonatomic, strong) IBOutlet UINavigationController *navigationController; @end diff --git a/ATPagingView/ATPagingViewDemo/Classes/ATPagingViewDemoAppDelegate.m b/ATPagingView/ATPagingViewDemo/Classes/ATPagingViewDemoAppDelegate.m index be0d580..e3a8560 100644 --- a/ATPagingView/ATPagingViewDemo/Classes/ATPagingViewDemoAppDelegate.m +++ b/ATPagingView/ATPagingViewDemo/Classes/ATPagingViewDemoAppDelegate.m @@ -49,10 +49,6 @@ - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { } -- (void)dealloc { - [window release]; - [super dealloc]; -} @end diff --git a/ATPagingView/ATPagingViewDemo/Classes/DemoPageView.m b/ATPagingView/ATPagingViewDemo/Classes/DemoPageView.m index eb553a8..fd03936 100644 --- a/ATPagingView/ATPagingViewDemo/Classes/DemoPageView.m +++ b/ATPagingView/ATPagingViewDemo/Classes/DemoPageView.m @@ -42,9 +42,6 @@ - (void)drawRect:(CGRect)rect { [[NSString stringWithFormat:@"Page %d", self.tag] drawInRect:textRect withFont:[UIFont boldSystemFontOfSize:17] lineBreakMode:UILineBreakModeClip alignment:UITextAlignmentCenter]; } -- (void)dealloc { - [super dealloc]; -} @end diff --git a/ATPagingView/ATPagingViewDemo/Classes/DemoViewController.m b/ATPagingView/ATPagingViewDemo/Classes/DemoViewController.m index c36534a..59150d8 100644 --- a/ATPagingView/ATPagingViewDemo/Classes/DemoViewController.m +++ b/ATPagingView/ATPagingViewDemo/Classes/DemoViewController.m @@ -14,6 +14,7 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + self.pagingView.horizontal = NO; self.pagingView.currentPageIndex = 3; [self currentPageDidChangeInPagingView:self.pagingView]; } @@ -29,7 +30,7 @@ - (NSInteger)numberOfPagesInPagingView:(ATPagingView *)pagingView { - (UIView *)viewForPageInPagingView:(ATPagingView *)pagingView atIndex:(NSInteger)index { UIView *view = [pagingView dequeueReusablePage]; if (view == nil) { - view = [[[DemoPageView alloc] init] autorelease]; + view = [[DemoPageView alloc] init]; } return view; } diff --git a/ATPagingView/ATPagingViewDemo/main.m b/ATPagingView/ATPagingViewDemo/main.m index bb45d53..a6eabd5 100644 --- a/ATPagingView/ATPagingViewDemo/main.m +++ b/ATPagingView/ATPagingViewDemo/main.m @@ -5,8 +5,8 @@ #import int main(int argc, char *argv[]) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, nil); - [pool release]; - return retVal; + @autoreleasepool { + int retVal = UIApplicationMain(argc, argv, nil, nil); + return retVal; + } } From cc8998cd7fe6e5e51c932eca3d314ccd8605e62a Mon Sep 17 00:00:00 2001 From: "Dio.Zhou" Date: Tue, 20 Nov 2012 00:29:12 +0800 Subject: [PATCH 2/3] Remove unuseful data --- .../contents.xcworkspacedata | 7 -- .../UserInterfaceState.xcuserstate | Bin 12735 -> 0 bytes .../WorkspaceSettings.xcsettings | 10 -- .../xcschemes/ATPagingViewDemo.xcscheme | 86 ------------------ .../xcschemes/xcschememanagement.plist | 22 ----- 5 files changed, 125 deletions(-) delete mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dio.xcuserdatad/UserInterfaceState.xcuserstate delete mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dio.xcuserdatad/WorkspaceSettings.xcsettings delete mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/ATPagingViewDemo.xcscheme delete mode 100644 ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 80d1d14..0000000 --- a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dio.xcuserdatad/UserInterfaceState.xcuserstate b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/dio.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 353dc148428f7e3bfecddcfb49e940d307137dfc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12735 zcmc(F34Bw<*7z(3}l-IAthv)v?3p`|U|LAFv51Panp3I$`@TuLNON|LgQZ{mU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emo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/ATPagingViewDemo.xcscheme b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/ATPagingViewDemo.xcscheme deleted file mode 100644 index 3e48b88..0000000 --- a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/ATPagingViewDemo.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/xcschememanagement.plist b/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 9c0976d..0000000 --- a/ATPagingView/ATPagingViewDemo/ATPagingViewDemo.xcodeproj/xcuserdata/dio.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - ATPagingViewDemo.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - 1D6058900D05DD3D006BFB54 - - primary - - - - - From 75dc9b2b3cbf7e45ef9f12b58ab339d96086d152 Mon Sep 17 00:00:00 2001 From: "Dio.Zhou" Date: Tue, 20 Nov 2012 17:33:08 +0800 Subject: [PATCH 3/3] fix a bug, when first time change currentPageIndex, UI not changed. --- ATPagingView/ATPagingView.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ATPagingView/ATPagingView.m b/ATPagingView/ATPagingView.m index c79c12f..ec8bea7 100644 --- a/ATPagingView/ATPagingView.m +++ b/ATPagingView/ATPagingView.m @@ -89,7 +89,7 @@ - (void)dealloc { _scrollView = nil; _delegate = nil; _recycledPages = nil; - _visiblePages = nil; + _visiblePages = nil; } @@ -352,8 +352,10 @@ - (void)setCurrentPageIndex:(NSInteger)newPageIndex { _scrollView.contentOffset = CGPointMake(0, _scrollView.frame.size.height * newPageIndex); }]; } - + _currentPageIndex = newPageIndex; + + [self configurePages]; } @@ -528,7 +530,6 @@ @implementation ATPagingViewController @synthesize pagingView=_pagingView; - #pragma mark - #pragma mark View Loading