├── .gitignore ├── Classes ├── GoAutoSlideView.h └── GoAutoSlideView.m ├── Example ├── Example.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Example │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── GoAutoSlideView │ │ ├── GoAutoSlideView.h │ │ └── GoAutoSlideView.m │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── ExampleTests │ ├── ExampleTests.m │ └── Info.plist └── ExampleUITests │ ├── ExampleUITests.m │ └── Info.plist ├── GoAutoSlideView.podspec ├── LICENSE ├── README.md └── Screenshots └── screenshot.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | 28 | # CocoaPods 29 | # 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 33 | # 34 | # Pods/ 35 | 36 | # Carthage 37 | # 38 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 39 | # Carthage/Checkouts 40 | 41 | Carthage/Build 42 | 43 | # fastlane 44 | # 45 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 46 | # screenshots whenever they are needed. 47 | # For more information about the recommended setup visit: 48 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 49 | 50 | fastlane/report.xml 51 | fastlane/screenshots 52 | 53 | .idea 54 | -------------------------------------------------------------------------------- /Classes/GoAutoSlideView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GoAutoSlideView.h 3 | // LetsGo 4 | // 5 | // Created by jamie on 15/12/21. 6 | // Copyright © 2015年 X-Monster. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class GoAutoSlideView; 14 | 15 | @protocol GoAutoSlideViewDataSource 16 | 17 | @required 18 | /** 19 | * Tells the data source to return the number of pages of a auto slide view. 20 | * 21 | * @param goAutoSlideView The auto slide view requesting the information. 22 | * 23 | * @return The number of pages of in auto slide view. 24 | */ 25 | - (NSInteger)numberOfPagesInGoAutoSlideView:(GoAutoSlideView *)goAutoSlideView; 26 | /** 27 | * Asks the data source for a page view at a particular location of the auto slide view. 28 | * 29 | * @param goAutoSlideView The auto slide view requesting the information. 30 | * @param page An index locating a page view in auto slide view. 31 | * 32 | * @return A view for the specified page. An assertion is raised if you return nil. 33 | */ 34 | - (nonnull UIView *)goAutoSlideView:(GoAutoSlideView *)goAutoSlideView viewAtPage:(NSInteger)page; 35 | 36 | @end 37 | 38 | @protocol GoAutoSlideViewDelegate 39 | 40 | @optional 41 | /** 42 | * Tells the delegate that the specified page is tapped. 43 | * 44 | * @param goAutoSlideView The auto slide view informing the new page view tapped. 45 | * @param page An index locating the new tapped page view in auto slide view. 46 | */ 47 | - (void)goAutoSlideView:(GoAutoSlideView *)goAutoSlideView didTapViewPage:(NSInteger)page; 48 | - (void)goAutoSlideView:(GoAutoSlideView *)goAutoSlideView didMoveToPage:(NSInteger)page; 49 | 50 | @end 51 | 52 | @interface GoAutoSlideView : UIView 53 | /** 54 | * The object that acts as the data source of the auto slide view. 55 | */ 56 | @property (nonatomic, weak, nullable) id slideDataSource; 57 | /** 58 | * The object that acts as the delegate of the auto slide view. 59 | */ 60 | @property (nonatomic, weak, nullable) id slideDelegate; 61 | /** 62 | * The period time the auto slide view slide. If not set, page views will not be slide automatically; 63 | */ 64 | @property (nonatomic, assign) NSTimeInterval slideDuration; 65 | /** 66 | * Disable the page indicator. The page indicator is shown by default. 67 | */ 68 | @property (nonatomic, assign) BOOL disablePageIndicator; 69 | /** 70 | * The color of the current page indicator. 71 | */ 72 | @property (nonatomic, strong, nullable) UIColor *currentPageIndicatorColor; 73 | /** 74 | * The color of the indicator except the current indicator. 75 | */ 76 | @property (nonatomic, strong, nullable) UIColor *pageIndicatorColor; 77 | /** 78 | * The bottom margin of indicator. 79 | */ 80 | @property (nonatomic, assign) CGFloat indicatorBottomMargin; 81 | /** 82 | * Loads/Reloads the page view of the auto slide view. 83 | */ 84 | - (void)reloadData; 85 | /** 86 | * Get current pages count. 87 | * 88 | * @return The pages count of the auto slide view. 89 | */ 90 | - (NSInteger)getPagesCount; 91 | 92 | /** 93 | * Get view at specified page 94 | * @param page The page of the view 95 | * @return The view of the specified page 96 | */ 97 | - (UIView *)viewAtPage:(NSInteger)page; 98 | 99 | NS_ASSUME_NONNULL_END 100 | @end 101 | -------------------------------------------------------------------------------- /Classes/GoAutoSlideView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GoAutoSlideView.m 3 | // LetsGo 4 | // 5 | // Created by jamie on 15/12/21. 6 | // Copyright © 2015年 X-Monster. All rights reserved. 7 | // 8 | 9 | #import "GoAutoSlideView.h" 10 | 11 | @interface GoAutoSlideView() 12 | 13 | @property (nonatomic, strong) NSTimer *slideTimer; 14 | 15 | @property (nonatomic, strong) UIPageControl *pageControl; 16 | 17 | @property (nonatomic, strong) NSMutableArray *contentViews; 18 | 19 | @property (nonatomic, strong) UIScrollView *scrollView;; 20 | @end 21 | 22 | @implementation GoAutoSlideView 23 | 24 | - (instancetype)init{ 25 | if (self = [super init]) { 26 | [self baseInit]; 27 | } 28 | return self; 29 | } 30 | 31 | - (instancetype)initWithFrame:(CGRect)frame{ 32 | if (self = [super initWithFrame:frame]) { 33 | [self baseInit]; 34 | } 35 | return self; 36 | } 37 | 38 | - (instancetype)initWithCoder:(NSCoder *)aDecoder{ 39 | if (self = [super initWithCoder:aDecoder]) { 40 | [self baseInit]; 41 | } 42 | return self; 43 | } 44 | 45 | - (void)baseInit{ 46 | self.scrollView = [[UIScrollView alloc] initWithFrame:self.bounds]; 47 | self.scrollView.pagingEnabled = YES; 48 | self.scrollView.scrollsToTop = NO; 49 | self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 50 | self.scrollView.delegate = self; 51 | self.scrollView.showsHorizontalScrollIndicator = NO; 52 | self.scrollView.showsVerticalScrollIndicator = NO; 53 | self.scrollView.bounces = NO; 54 | [self addSubview:self.scrollView]; 55 | 56 | self.contentViews = [NSMutableArray new]; 57 | } 58 | 59 | #pragma mark Private 60 | 61 | - (void)resetPageControl{ 62 | if (self.disablePageIndicator) { 63 | [self.pageControl removeFromSuperview]; 64 | return; 65 | } 66 | if (!self.pageControl) { 67 | self.pageControl = [[UIPageControl alloc] init]; 68 | self.pageControl.hidesForSinglePage = YES; 69 | self.pageControl.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; 70 | self.pageControl.center = CGPointMake(CGRectGetWidth(self.bounds) / 2, CGRectGetHeight(self.bounds) - (self.indicatorBottomMargin > 0 ? self.indicatorBottomMargin : 20)); 71 | [self addSubview:self.pageControl]; 72 | } 73 | if ([self.slideDataSource respondsToSelector:@selector(numberOfPagesInGoAutoSlideView:)]) { 74 | NSInteger pageCount = [self.slideDataSource numberOfPagesInGoAutoSlideView:self]; 75 | self.pageControl.numberOfPages = pageCount; 76 | }else{ 77 | self.pageControl.numberOfPages = 0; 78 | } 79 | if (self.currentPageIndicatorColor != nil) { 80 | [self.pageControl setCurrentPageIndicatorTintColor:self.currentPageIndicatorColor]; 81 | }else{ 82 | [self.pageControl setCurrentPageIndicatorTintColor:[UIColor blueColor]]; 83 | } 84 | if (self.pageIndicatorColor != nil) { 85 | [self.pageControl setPageIndicatorTintColor:self.pageIndicatorColor]; 86 | }else{ 87 | [self.pageControl setPageIndicatorTintColor:[UIColor whiteColor]]; 88 | } 89 | } 90 | 91 | - (void)onTimerFired{ 92 | CGPoint newOffset = CGPointMake(self.scrollView.contentOffset.x + CGRectGetWidth(self.bounds), self.scrollView.contentOffset.y); 93 | [self.scrollView setContentOffset:newOffset animated:NO]; 94 | } 95 | 96 | - (void)resetSubViewsFrame{ 97 | for (NSInteger i = 0; i < [self.contentViews count]; i++) { 98 | UIView *view = [self.contentViews objectAtIndex:i]; 99 | [view setFrame:CGRectMake(CGRectGetWidth(self.bounds) * i, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; 100 | } 101 | if ([self.contentViews count] > 1) { 102 | UIView *currentView = [self.contentViews objectAtIndex:1]; 103 | NSInteger currentPage = currentView.tag; 104 | [self.pageControl setCurrentPage:currentPage]; 105 | if([self.slideDelegate respondsToSelector:@selector(goAutoSlideView:didMoveToPage:)]){ 106 | [self.slideDelegate goAutoSlideView:self didMoveToPage:currentPage]; 107 | } 108 | } 109 | } 110 | 111 | - (void)rotateViewsRight { 112 | UIView *lastView = [self.contentViews lastObject]; 113 | [self.contentViews removeLastObject]; 114 | [self.contentViews insertObject:lastView atIndex:0]; 115 | [self resetSubViewsFrame]; 116 | } 117 | 118 | - (void)rotateViewsLeft { 119 | UIView *firstView = [self.contentViews firstObject]; 120 | [self.contentViews removeObjectAtIndex:0]; 121 | [self.contentViews addObject:firstView]; 122 | [self resetSubViewsFrame]; 123 | } 124 | 125 | - (void)onPageTaped:(UITapGestureRecognizer *)recognizer { 126 | UIView *tapedView = recognizer.view; 127 | if ([self.slideDelegate respondsToSelector:@selector(goAutoSlideView:didTapViewPage:)]) { 128 | [self.slideDelegate goAutoSlideView:self didTapViewPage:tapedView.tag]; 129 | } 130 | } 131 | 132 | #pragma mark Public 133 | - (void)reloadData{ 134 | [self stopAutoScroll]; 135 | [self.scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; 136 | [self.contentViews removeAllObjects]; 137 | if ([self.slideDataSource respondsToSelector:@selector(numberOfPagesInGoAutoSlideView:)]) { 138 | NSInteger pageCount = [self.slideDataSource numberOfPagesInGoAutoSlideView:self]; 139 | 140 | for (NSInteger i = 0; i < pageCount; i++) { 141 | if ([self.slideDataSource respondsToSelector:@selector(goAutoSlideView:viewAtPage:)]) { 142 | UIView *pageView = [self.slideDataSource goAutoSlideView:self viewAtPage:i]; 143 | NSAssert(pageView != nil, @"page view can not be nil!"); 144 | pageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 145 | [pageView setUserInteractionEnabled:YES]; 146 | if([self.slideDelegate respondsToSelector:@selector(goAutoSlideView:didTapViewPage:)]){ 147 | UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onPageTaped:)]; 148 | [pageView addGestureRecognizer:tapRecognizer]; 149 | } 150 | [pageView setTag:i]; 151 | [self.contentViews addObject:pageView]; 152 | [self.scrollView addSubview:pageView]; 153 | } 154 | } 155 | if (pageCount > 1) { 156 | [self.scrollView setContentSize:CGSizeMake(CGRectGetWidth(self.bounds) * 3, CGRectGetHeight(self.bounds))]; 157 | [self.scrollView setContentOffset:CGPointMake(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; 158 | [self rotateViewsRight]; 159 | }else if(pageCount == 1){ 160 | [self.scrollView setContentSize:self.bounds.size]; 161 | [self.scrollView setContentOffset:CGPointMake(0, CGRectGetHeight(self.bounds))]; 162 | UIView *view = [self.contentViews firstObject]; 163 | [view setFrame:self.bounds]; 164 | } 165 | } 166 | 167 | [self resetPageControl]; 168 | [self startAutoScroll]; 169 | } 170 | 171 | - (NSInteger)getPagesCount{ 172 | return self.contentViews.count; 173 | } 174 | 175 | - (void)setSlideDuration:(NSTimeInterval)slideDuration{ 176 | NSAssert(slideDuration > 0, @"slideDuration must be greater than 0"); 177 | _slideDuration = slideDuration; 178 | if (self.slideTimer != nil) { 179 | [self.slideTimer invalidate]; 180 | self.slideTimer = nil; 181 | } 182 | self.slideTimer = [NSTimer scheduledTimerWithTimeInterval:self.slideDuration 183 | target:self 184 | selector:@selector(onTimerFired) 185 | userInfo:nil 186 | repeats:YES]; 187 | } 188 | 189 | - (void)setDisablePageIndicator:(BOOL)disablePageIndicator{ 190 | _disablePageIndicator = disablePageIndicator; 191 | [self resetPageControl]; 192 | } 193 | 194 | - (void)startAutoScroll{ 195 | if ([self.slideTimer isValid] && [self.contentViews count] > 1) { 196 | [self.slideTimer setFireDate:[NSDate dateWithTimeInterval:[self slideDuration] 197 | sinceDate:[NSDate date]]]; 198 | } 199 | } 200 | 201 | - (void)stopAutoScroll{ 202 | if ([self.slideTimer isValid]) { 203 | [self.slideTimer setFireDate:[NSDate distantFuture]]; 204 | } 205 | } 206 | 207 | #pragma mark UIScrollViewDelegate 208 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{ 209 | [self stopAutoScroll]; 210 | } 211 | 212 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ 213 | [self startAutoScroll]; 214 | } 215 | 216 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ 217 | if ([self.contentViews count] > 1) { 218 | if ([self.contentViews count] == 2) { 219 | if (scrollView.contentOffset.x > CGRectGetWidth(self.bounds)) { 220 | UIView *nextView = (UIView *)[self.contentViews firstObject]; 221 | [nextView setFrame:CGRectMake(2 * CGRectGetWidth(self.bounds), 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; 222 | } else if (scrollView.contentOffset.x < CGRectGetWidth(self.bounds)) { 223 | UIView *nextView = (UIView *)[self.contentViews firstObject]; 224 | [nextView setFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; 225 | } 226 | } 227 | if (scrollView.contentOffset.x == 0) { 228 | CGPoint newOffset = CGPointMake(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); 229 | [self.scrollView setContentOffset:newOffset]; 230 | [self rotateViewsRight]; 231 | }else if(scrollView.contentOffset.x == CGRectGetWidth(self.bounds) * 2){ 232 | CGPoint newOffset = CGPointMake(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); 233 | [self.scrollView setContentOffset:newOffset]; 234 | [self rotateViewsLeft]; 235 | } 236 | } 237 | scrollView.contentOffset = CGPointMake(scrollView.contentOffset.x, 0); 238 | } 239 | 240 | - (UIView *)viewAtPage:(NSInteger)page { 241 | __block UIView *pageView; 242 | [self.contentViews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 243 | UIView *view = obj; 244 | if(view.tag == page){ 245 | pageView = view; 246 | *stop = YES; 247 | } 248 | }]; 249 | return pageView; 250 | } 251 | @end 252 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6037917F90A567A7F31218C7 /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 603790B2FDA1CEF39FD0F91E /* ExampleTests.m */; }; 11 | 60379537653357E73E49868D /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 60379B9330DD2E08341234C7 /* Info.plist */; }; 12 | 6037959035598D92BA900891 /* GoAutoSlideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 603799B2C19B413351C2D906 /* GoAutoSlideView.m */; }; 13 | 603795E4C74045A8BBE6BA83 /* ExampleUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6037967B12AAD5C933FD5A55 /* ExampleUITests.m */; }; 14 | 6037963CD6ECC96F510981BA /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 603792EE280A65F466232ED2 /* Info.plist */; }; 15 | 6037985ABDF60EC1690108E1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 603792E4F5911F247DC04751 /* LaunchScreen.storyboard */; }; 16 | 603798993A376435FF5DBA65 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 60379EF9F142A060BEFD4899 /* AppDelegate.m */; }; 17 | 60379A04BAA74F2358450A4B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 603795C233F43D1DDA5BB287 /* main.m */; }; 18 | 60379B67F228800B95FD5D23 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 603799854486850F0A3837BE /* Info.plist */; }; 19 | 60379C85A71238843D73782C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 60379E5E382B28E9C756E29E /* Main.storyboard */; }; 20 | 60379D5B0A42AC0357E5E350 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 60379EB65DA9C0B244FB3C77 /* Assets.xcassets */; }; 21 | 60379F0826169A1124579A69 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 60379677CE3056A6FFB7F62F /* ViewController.m */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 60379C6D44B84A8A879A08D2 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 6037961CF214D11A317C1ADC /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 603798C465ACB5A29EF9BB40; 30 | remoteInfo = Example; 31 | }; 32 | 60379CD6ACA6662534C7FBEC /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 6037961CF214D11A317C1ADC /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 603798C465ACB5A29EF9BB40; 37 | remoteInfo = Example; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 603790B2FDA1CEF39FD0F91E /* ExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleTests.m; sourceTree = ""; }; 43 | 603792EE280A65F466232ED2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.info; path = Info.plist; sourceTree = ""; }; 44 | 603795C233F43D1DDA5BB287 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | 60379677CE3056A6FFB7F62F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 46 | 6037967B12AAD5C933FD5A55 /* ExampleUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleUITests.m; sourceTree = ""; }; 47 | 6037971083C88BC0D5BB7052 /* GoAutoSlideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoAutoSlideView.h; sourceTree = ""; }; 48 | 6037973A986919A922D6F01D /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 603797E2C80E536E011D7D0E /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 603797F073EFFDFC311E0D2B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 51 | 6037996628129F5DC0999AC6 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 603799854486850F0A3837BE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.info; path = Info.plist; sourceTree = ""; }; 53 | 6037998F06EA62180C4A38FC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 54 | 603799B2C19B413351C2D906 /* GoAutoSlideView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoAutoSlideView.m; sourceTree = ""; }; 55 | 60379B9330DD2E08341234C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.info; path = Info.plist; sourceTree = ""; }; 56 | 60379BE11B07AF759F568C85 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 57 | 60379C9C9BE9EA715E8E7F33 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 60379EB65DA9C0B244FB3C77 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 59 | 60379EF9F142A060BEFD4899 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 6037901E2D6F83A938E86F23 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | 60379169CB531CC5CFAC8104 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | 60379E3D358A49B8CA9378D6 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | 603791D753110271C0F95BED /* Example */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 60379B9330DD2E08341234C7 /* Info.plist */, 91 | 60379EB65DA9C0B244FB3C77 /* Assets.xcassets */, 92 | 603792E4F5911F247DC04751 /* LaunchScreen.storyboard */, 93 | 60379438B9A13E9C59CB2535 /* Supporting Files */, 94 | 6037998F06EA62180C4A38FC /* AppDelegate.h */, 95 | 60379EF9F142A060BEFD4899 /* AppDelegate.m */, 96 | 60379E5E382B28E9C756E29E /* Main.storyboard */, 97 | 603797F073EFFDFC311E0D2B /* ViewController.h */, 98 | 60379677CE3056A6FFB7F62F /* ViewController.m */, 99 | 60379D6F26CC4739383ED66B /* GoAutoSlideView */, 100 | ); 101 | path = Example; 102 | sourceTree = ""; 103 | }; 104 | 6037933288EED56E975895E2 = { 105 | isa = PBXGroup; 106 | children = ( 107 | 6037945B2B365CC1B9B99669 /* Products */, 108 | 603791D753110271C0F95BED /* Example */, 109 | 603793D2B5201A87055B9B0B /* ExampleTests */, 110 | 60379A1FEFD125E34421014E /* ExampleUITests */, 111 | ); 112 | sourceTree = ""; 113 | }; 114 | 603793D2B5201A87055B9B0B /* ExampleTests */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 603799854486850F0A3837BE /* Info.plist */, 118 | 603790B2FDA1CEF39FD0F91E /* ExampleTests.m */, 119 | ); 120 | path = ExampleTests; 121 | sourceTree = ""; 122 | }; 123 | 60379438B9A13E9C59CB2535 /* Supporting Files */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 603795C233F43D1DDA5BB287 /* main.m */, 127 | ); 128 | name = "Supporting Files"; 129 | sourceTree = ""; 130 | }; 131 | 6037945B2B365CC1B9B99669 /* Products */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 6037996628129F5DC0999AC6 /* Example.app */, 135 | 603797E2C80E536E011D7D0E /* ExampleTests.xctest */, 136 | 6037973A986919A922D6F01D /* ExampleUITests.xctest */, 137 | ); 138 | name = Products; 139 | sourceTree = ""; 140 | }; 141 | 60379A1FEFD125E34421014E /* ExampleUITests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 603792EE280A65F466232ED2 /* Info.plist */, 145 | 6037967B12AAD5C933FD5A55 /* ExampleUITests.m */, 146 | ); 147 | path = ExampleUITests; 148 | sourceTree = ""; 149 | }; 150 | 60379D6F26CC4739383ED66B /* GoAutoSlideView */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 6037971083C88BC0D5BB7052 /* GoAutoSlideView.h */, 154 | 603799B2C19B413351C2D906 /* GoAutoSlideView.m */, 155 | ); 156 | path = GoAutoSlideView; 157 | sourceTree = ""; 158 | }; 159 | /* End PBXGroup section */ 160 | 161 | /* Begin PBXNativeTarget section */ 162 | 603795EF341B1A4D8ED45EA1 /* ExampleUITests */ = { 163 | isa = PBXNativeTarget; 164 | buildConfigurationList = 6037983CF77FB65A0339AC4A /* Build configuration list for PBXNativeTarget "ExampleUITests" */; 165 | buildPhases = ( 166 | 6037905AB33546023CF66E09 /* Sources */, 167 | 60379E3D358A49B8CA9378D6 /* Frameworks */, 168 | 603794019A2F7F39912871EB /* Resources */, 169 | ); 170 | buildRules = ( 171 | ); 172 | dependencies = ( 173 | 603793F754FB8D8EC93F1B49 /* PBXTargetDependency */, 174 | ); 175 | name = ExampleUITests; 176 | productName = ExampleUITests; 177 | productReference = 6037973A986919A922D6F01D /* ExampleUITests.xctest */; 178 | productType = "com.apple.product-type.bundle.ui-testing"; 179 | }; 180 | 603798C465ACB5A29EF9BB40 /* Example */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = 60379C74AA1939217D2D8C5A /* Build configuration list for PBXNativeTarget "Example" */; 183 | buildPhases = ( 184 | 603792A44578DD60E3402F2F /* Sources */, 185 | 60379169CB531CC5CFAC8104 /* Frameworks */, 186 | 60379232CEF4CE9DB51A9DF5 /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | ); 192 | name = Example; 193 | productName = Example; 194 | productReference = 6037996628129F5DC0999AC6 /* Example.app */; 195 | productType = "com.apple.product-type.application"; 196 | }; 197 | 60379A3F3B4707D033723675 /* ExampleTests */ = { 198 | isa = PBXNativeTarget; 199 | buildConfigurationList = 60379A9BC20D17AC9E3F3455 /* Build configuration list for PBXNativeTarget "ExampleTests" */; 200 | buildPhases = ( 201 | 60379DCAD4561D3926B39EC9 /* Sources */, 202 | 6037901E2D6F83A938E86F23 /* Frameworks */, 203 | 6037962BEE1EBC8E3975FA80 /* Resources */, 204 | ); 205 | buildRules = ( 206 | ); 207 | dependencies = ( 208 | 603790D9BEE97B554D072DA9 /* PBXTargetDependency */, 209 | ); 210 | name = ExampleTests; 211 | productName = ExampleTests; 212 | productReference = 603797E2C80E536E011D7D0E /* ExampleTests.xctest */; 213 | productType = "com.apple.product-type.bundle.unit-test"; 214 | }; 215 | /* End PBXNativeTarget section */ 216 | 217 | /* Begin PBXProject section */ 218 | 6037961CF214D11A317C1ADC /* Project object */ = { 219 | isa = PBXProject; 220 | attributes = { 221 | ORGANIZATIONNAME = "X-Monster"; 222 | }; 223 | buildConfigurationList = 6037925460B07B69EE98FD6F /* Build configuration list for PBXProject "Example" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | ); 230 | mainGroup = 6037933288EED56E975895E2; 231 | productRefGroup = 6037945B2B365CC1B9B99669 /* Products */; 232 | projectDirPath = ""; 233 | projectRoot = ""; 234 | targets = ( 235 | 603798C465ACB5A29EF9BB40 /* Example */, 236 | 60379A3F3B4707D033723675 /* ExampleTests */, 237 | 603795EF341B1A4D8ED45EA1 /* ExampleUITests */, 238 | ); 239 | }; 240 | /* End PBXProject section */ 241 | 242 | /* Begin PBXResourcesBuildPhase section */ 243 | 60379232CEF4CE9DB51A9DF5 /* Resources */ = { 244 | isa = PBXResourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | 60379537653357E73E49868D /* Info.plist in Resources */, 248 | 60379D5B0A42AC0357E5E350 /* Assets.xcassets in Resources */, 249 | 6037985ABDF60EC1690108E1 /* LaunchScreen.storyboard in Resources */, 250 | 60379C85A71238843D73782C /* Main.storyboard in Resources */, 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | 603794019A2F7F39912871EB /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | 6037963CD6ECC96F510981BA /* Info.plist in Resources */, 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | 6037962BEE1EBC8E3975FA80 /* Resources */ = { 263 | isa = PBXResourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | 60379B67F228800B95FD5D23 /* Info.plist in Resources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | /* End PBXResourcesBuildPhase section */ 271 | 272 | /* Begin PBXSourcesBuildPhase section */ 273 | 6037905AB33546023CF66E09 /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | 603795E4C74045A8BBE6BA83 /* ExampleUITests.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | 603792A44578DD60E3402F2F /* Sources */ = { 282 | isa = PBXSourcesBuildPhase; 283 | buildActionMask = 2147483647; 284 | files = ( 285 | 60379A04BAA74F2358450A4B /* main.m in Sources */, 286 | 603798993A376435FF5DBA65 /* AppDelegate.m in Sources */, 287 | 60379F0826169A1124579A69 /* ViewController.m in Sources */, 288 | 6037959035598D92BA900891 /* GoAutoSlideView.m in Sources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | 60379DCAD4561D3926B39EC9 /* Sources */ = { 293 | isa = PBXSourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | 6037917F90A567A7F31218C7 /* ExampleTests.m in Sources */, 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | /* End PBXSourcesBuildPhase section */ 301 | 302 | /* Begin PBXTargetDependency section */ 303 | 603790D9BEE97B554D072DA9 /* PBXTargetDependency */ = { 304 | isa = PBXTargetDependency; 305 | target = 603798C465ACB5A29EF9BB40 /* Example */; 306 | targetProxy = 60379C6D44B84A8A879A08D2 /* PBXContainerItemProxy */; 307 | }; 308 | 603793F754FB8D8EC93F1B49 /* PBXTargetDependency */ = { 309 | isa = PBXTargetDependency; 310 | target = 603798C465ACB5A29EF9BB40 /* Example */; 311 | targetProxy = 60379CD6ACA6662534C7FBEC /* PBXContainerItemProxy */; 312 | }; 313 | /* End PBXTargetDependency section */ 314 | 315 | /* Begin PBXVariantGroup section */ 316 | 603792E4F5911F247DC04751 /* LaunchScreen.storyboard */ = { 317 | isa = PBXVariantGroup; 318 | children = ( 319 | 60379C9C9BE9EA715E8E7F33 /* Base */, 320 | ); 321 | name = LaunchScreen.storyboard; 322 | sourceTree = ""; 323 | }; 324 | 60379E5E382B28E9C756E29E /* Main.storyboard */ = { 325 | isa = PBXVariantGroup; 326 | children = ( 327 | 60379BE11B07AF759F568C85 /* Base */, 328 | ); 329 | name = Main.storyboard; 330 | sourceTree = ""; 331 | }; 332 | /* End PBXVariantGroup section */ 333 | 334 | /* Begin XCBuildConfiguration section */ 335 | 603793E74B3BA67974951453 /* Debug */ = { 336 | isa = XCBuildConfiguration; 337 | buildSettings = { 338 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 339 | INFOPLIST_FILE = Example/Info.plist; 340 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 341 | PRODUCT_BUNDLE_IDENTIFIER = com.xmonster.Example; 342 | PRODUCT_NAME = "$(TARGET_NAME)"; 343 | }; 344 | name = Debug; 345 | }; 346 | 603795FE9094EC6E227EEBC0 /* Release */ = { 347 | isa = XCBuildConfiguration; 348 | buildSettings = { 349 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 350 | INFOPLIST_FILE = Example/Info.plist; 351 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 352 | PRODUCT_BUNDLE_IDENTIFIER = com.xmonster.Example; 353 | PRODUCT_NAME = "$(TARGET_NAME)"; 354 | }; 355 | name = Release; 356 | }; 357 | 60379B564D9A114CDB426433 /* Debug */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; 361 | INFOPLIST_FILE = ExampleUITests/Info.plist; 362 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 363 | PRODUCT_BUNDLE_IDENTIFIER = com.xmonster.ExampleUITests; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | TEST_HOST = "$(BUNDLE_LOADER)"; 366 | }; 367 | name = Debug; 368 | }; 369 | 60379BA054FDF491035765DF /* Release */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; 373 | INFOPLIST_FILE = ExampleTests/Info.plist; 374 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 375 | PRODUCT_BUNDLE_IDENTIFIER = com.xmonster.ExampleTests; 376 | PRODUCT_NAME = "$(TARGET_NAME)"; 377 | TEST_HOST = "$(BUNDLE_LOADER)"; 378 | }; 379 | name = Release; 380 | }; 381 | 60379BA59248ED50873B59BD /* Release */ = { 382 | isa = XCBuildConfiguration; 383 | buildSettings = { 384 | ALWAYS_SEARCH_USER_PATHS = NO; 385 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 386 | CLANG_CXX_LIBRARY = "libc++"; 387 | CLANG_ENABLE_MODULES = YES; 388 | CLANG_ENABLE_OBJC_ARC = YES; 389 | CLANG_WARN_BOOL_CONVERSION = YES; 390 | CLANG_WARN_CONSTANT_CONVERSION = YES; 391 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 392 | CLANG_WARN_EMPTY_BODY = YES; 393 | CLANG_WARN_ENUM_CONVERSION = YES; 394 | CLANG_WARN_INT_CONVERSION = YES; 395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 396 | CLANG_WARN_UNREACHABLE_CODE = YES; 397 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 398 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 399 | COPY_PHASE_STRIP = NO; 400 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 401 | ENABLE_NS_ASSERTIONS = NO; 402 | ENABLE_STRICT_OBJC_MSGSEND = YES; 403 | GCC_C_LANGUAGE_STANDARD = gnu99; 404 | GCC_NO_COMMON_BLOCKS = YES; 405 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 406 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 407 | GCC_WARN_UNDECLARED_SELECTOR = YES; 408 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 409 | GCC_WARN_UNUSED_FUNCTION = YES; 410 | GCC_WARN_UNUSED_VARIABLE = YES; 411 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 412 | MTL_ENABLE_DEBUG_INFO = NO; 413 | SDKROOT = iphoneos; 414 | VALIDATE_PRODUCT = YES; 415 | }; 416 | name = Release; 417 | }; 418 | 60379F368D954810326E8806 /* Release */ = { 419 | isa = XCBuildConfiguration; 420 | buildSettings = { 421 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; 422 | INFOPLIST_FILE = ExampleUITests/Info.plist; 423 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 424 | PRODUCT_BUNDLE_IDENTIFIER = com.xmonster.ExampleUITests; 425 | PRODUCT_NAME = "$(TARGET_NAME)"; 426 | TEST_HOST = "$(BUNDLE_LOADER)"; 427 | }; 428 | name = Release; 429 | }; 430 | 60379F49A20BAB25D548B93A /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | ALWAYS_SEARCH_USER_PATHS = NO; 434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 435 | CLANG_CXX_LIBRARY = "libc++"; 436 | CLANG_ENABLE_MODULES = YES; 437 | CLANG_ENABLE_OBJC_ARC = YES; 438 | CLANG_WARN_BOOL_CONVERSION = YES; 439 | CLANG_WARN_CONSTANT_CONVERSION = YES; 440 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 441 | CLANG_WARN_EMPTY_BODY = YES; 442 | CLANG_WARN_ENUM_CONVERSION = YES; 443 | CLANG_WARN_INT_CONVERSION = YES; 444 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 445 | CLANG_WARN_UNREACHABLE_CODE = YES; 446 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 447 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 448 | COPY_PHASE_STRIP = NO; 449 | DEBUG_INFORMATION_FORMAT = dwarf; 450 | ENABLE_STRICT_OBJC_MSGSEND = YES; 451 | ENABLE_TESTABILITY = YES; 452 | GCC_C_LANGUAGE_STANDARD = gnu99; 453 | GCC_DYNAMIC_NO_PIC = NO; 454 | GCC_NO_COMMON_BLOCKS = YES; 455 | GCC_OPTIMIZATION_LEVEL = 0; 456 | GCC_PREPROCESSOR_DEFINITIONS = ( 457 | "DEBUG=1", 458 | "$(inherited)", 459 | ); 460 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 461 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 462 | GCC_WARN_UNDECLARED_SELECTOR = YES; 463 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 464 | GCC_WARN_UNUSED_FUNCTION = YES; 465 | GCC_WARN_UNUSED_VARIABLE = YES; 466 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 467 | MTL_ENABLE_DEBUG_INFO = YES; 468 | ONLY_ACTIVE_ARCH = YES; 469 | SDKROOT = iphoneos; 470 | }; 471 | name = Debug; 472 | }; 473 | 60379FB3993FD48F95907AC5 /* Debug */ = { 474 | isa = XCBuildConfiguration; 475 | buildSettings = { 476 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; 477 | INFOPLIST_FILE = ExampleTests/Info.plist; 478 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 479 | PRODUCT_BUNDLE_IDENTIFIER = com.xmonster.ExampleTests; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | TEST_HOST = "$(BUNDLE_LOADER)"; 482 | }; 483 | name = Debug; 484 | }; 485 | /* End XCBuildConfiguration section */ 486 | 487 | /* Begin XCConfigurationList section */ 488 | 6037925460B07B69EE98FD6F /* Build configuration list for PBXProject "Example" */ = { 489 | isa = XCConfigurationList; 490 | buildConfigurations = ( 491 | 60379F49A20BAB25D548B93A /* Debug */, 492 | 60379BA59248ED50873B59BD /* Release */, 493 | ); 494 | defaultConfigurationIsVisible = 0; 495 | defaultConfigurationName = Release; 496 | }; 497 | 6037983CF77FB65A0339AC4A /* Build configuration list for PBXNativeTarget "ExampleUITests" */ = { 498 | isa = XCConfigurationList; 499 | buildConfigurations = ( 500 | 60379B564D9A114CDB426433 /* Debug */, 501 | 60379F368D954810326E8806 /* Release */, 502 | ); 503 | defaultConfigurationIsVisible = 0; 504 | }; 505 | 60379A9BC20D17AC9E3F3455 /* Build configuration list for PBXNativeTarget "ExampleTests" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 60379FB3993FD48F95907AC5 /* Debug */, 509 | 60379BA054FDF491035765DF /* Release */, 510 | ); 511 | defaultConfigurationIsVisible = 0; 512 | }; 513 | 60379C74AA1939217D2D8C5A /* Build configuration list for PBXNativeTarget "Example" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | 603793E74B3BA67974951453 /* Debug */, 517 | 603795FE9094EC6E227EEBC0 /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | }; 521 | /* End XCConfigurationList section */ 522 | }; 523 | rootObject = 6037961CF214D11A317C1ADC /* Project object */; 524 | } 525 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Example 4 | // 5 | // Created by jamie on 16/3/9. 6 | // Copyright (c) 2016 X-Monster. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Example 4 | // 5 | // Created by jamie on 16/3/9. 6 | // Copyright (c) 2016 X-Monster. All rights reserved. 7 | // 8 | 9 | 10 | #import "AppDelegate.h" 11 | 12 | 13 | @interface AppDelegate () 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | 20 | 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 23 | // Override point for customization after application launch. 24 | return YES; 25 | } 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application { 28 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 29 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 30 | 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application { 34 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 35 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 36 | 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application { 40 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 41 | } 42 | 43 | - (void)applicationDidBecomeActive:(UIApplication *)application { 44 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application { 48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 49 | } 50 | 51 | 52 | @end -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example/Example/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/Example/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Example/GoAutoSlideView/GoAutoSlideView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GoAutoSlideView.h 3 | // LetsGo 4 | // 5 | // Created by jamie on 15/12/21. 6 | // Copyright © 2015年 X-Monster. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GoAutoSlideView; 12 | @protocol GoAutoSlideViewDataSource 13 | 14 | @required 15 | /** 16 | * Tells the data source to return the number of pages of a auto slide view. 17 | * 18 | * @param goAutoSlideView The auto slide view requesting the information. 19 | * 20 | * @return The number of pages of in auto slide view. 21 | */ 22 | - (NSInteger)numberOfPagesInGoAutoSlideView:(nonnull GoAutoSlideView *)goAutoSlideView; 23 | /** 24 | * Asks the data source for a page view at a particular location of the auto slide view. 25 | * 26 | * @param goAutoSlideView The auto slide view requesting the information. 27 | * @param page An index locating a page view in auto slide view. 28 | * 29 | * @return A view for the specified page. An assertion is raised if you return nil. 30 | */ 31 | - (nonnull UIView *)goAutoSlideView:(nonnull GoAutoSlideView *)goAutoSlideView viewAtPage:(NSInteger)page; 32 | 33 | @end 34 | 35 | @protocol GoAutoSlideViewDelegate 36 | 37 | @optional 38 | /** 39 | * Tells the delegate that the specified page is tapped. 40 | * 41 | * @param goAutoSlideView The auto slide view informing the new page view tapped. 42 | * @param page An index locating the new tapped page view in auto slide view. 43 | */ 44 | - (void)goAutoSlideView:(nonnull GoAutoSlideView *)goAutoSlideView didTapViewPage:(NSInteger)page; 45 | 46 | @end 47 | 48 | @interface GoAutoSlideView : UIView 49 | /** 50 | * The object that acts as the data source of the auto slide view. 51 | */ 52 | @property (nonatomic, weak) id slideDataSource; 53 | /** 54 | * The object that acts as the delegate of the auto slide view. 55 | */ 56 | @property (nonatomic, weak) id slideDelegate; 57 | /** 58 | * The period time the auto slide view slide. If not set, page views will not be slide automatically; 59 | */ 60 | @property (nonatomic, assign) NSTimeInterval slideDuration; 61 | /** 62 | * Disable the page indicator. The page indicator is shown by default. 63 | */ 64 | @property (nonatomic, assign) BOOL disablePageIndicator; 65 | /** 66 | * The color of the current page indicator. 67 | */ 68 | @property (nonatomic, strong, nullable) UIColor *currentPageIndicatorColor; 69 | /** 70 | * The color of the indicator except the current indicator. 71 | */ 72 | @property (nonatomic, strong, nullable) UIColor *pageIndicatorColor; 73 | /** 74 | * Loads/Reloads the page view of the auto slide view. 75 | */ 76 | - (void)reloadData; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Example/Example/GoAutoSlideView/GoAutoSlideView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GoAutoSlideView.m 3 | // LetsGo 4 | // 5 | // Created by jamie on 15/12/21. 6 | // Copyright © 2015年 X-Monster. All rights reserved. 7 | // 8 | 9 | #import "GoAutoSlideView.h" 10 | 11 | @interface GoAutoSlideView() 12 | 13 | @property (nonatomic, strong) NSTimer *slideTimer; 14 | 15 | @property (nonatomic, assign) NSInteger pageCount; 16 | 17 | @property (nonatomic, strong) UIPageControl *pageControl; 18 | 19 | @property (nonatomic, strong) NSMutableArray *contentViews; 20 | 21 | @property (nonatomic, strong) UIScrollView *scrollView;; 22 | @end 23 | 24 | @implementation GoAutoSlideView 25 | 26 | - (instancetype)init{ 27 | if (self = [super init]) { 28 | [self baseInit]; 29 | } 30 | return self; 31 | } 32 | 33 | - (instancetype)initWithFrame:(CGRect)frame{ 34 | if (self = [super initWithFrame:frame]) { 35 | [self baseInit]; 36 | } 37 | return self; 38 | } 39 | 40 | - (instancetype)initWithCoder:(NSCoder *)aDecoder{ 41 | if (self = [super initWithCoder:aDecoder]) { 42 | [self baseInit]; 43 | } 44 | return self; 45 | } 46 | 47 | - (void)baseInit{ 48 | self.scrollView = [[UIScrollView alloc] initWithFrame:self.bounds]; 49 | self.scrollView.pagingEnabled = YES; 50 | self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 51 | self.scrollView.delegate = self; 52 | self.scrollView.showsHorizontalScrollIndicator = NO; 53 | self.scrollView.showsVerticalScrollIndicator = NO; 54 | self.scrollView.bounces = NO; 55 | [self addSubview:self.scrollView]; 56 | 57 | self.contentViews = [NSMutableArray new]; 58 | } 59 | 60 | #pragma mark Private 61 | 62 | - (void)resetPageControl{ 63 | if (self.disablePageIndicator) { 64 | [self.pageControl removeFromSuperview]; 65 | return; 66 | } 67 | if (!self.pageControl) { 68 | self.pageControl = [[UIPageControl alloc] init]; 69 | self.pageControl.hidesForSinglePage = YES; 70 | self.pageControl.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; 71 | self.pageControl.center = CGPointMake(CGRectGetWidth(self.bounds) / 2, CGRectGetHeight(self.bounds) - 20); 72 | [self addSubview:self.pageControl]; 73 | } 74 | if ([self.slideDataSource respondsToSelector:@selector(numberOfPagesInGoAutoSlideView:)]) { 75 | NSInteger pageCount = [self.slideDataSource numberOfPagesInGoAutoSlideView:self]; 76 | self.pageControl.numberOfPages = pageCount; 77 | }else{ 78 | self.pageControl.numberOfPages = 0; 79 | } 80 | if (self.currentPageIndicatorColor != nil) { 81 | [self.pageControl setCurrentPageIndicatorTintColor:self.currentPageIndicatorColor]; 82 | }else{ 83 | [self.pageControl setCurrentPageIndicatorTintColor:[UIColor blueColor]]; 84 | } 85 | if (self.pageIndicatorColor != nil) { 86 | [self.pageControl setPageIndicatorTintColor:self.pageIndicatorColor]; 87 | }else{ 88 | [self.pageControl setPageIndicatorTintColor:[UIColor whiteColor]]; 89 | } 90 | } 91 | 92 | - (void)onTimerFired{ 93 | CGPoint newOffset = CGPointMake(self.scrollView.contentOffset.x + CGRectGetWidth(self.bounds), self.scrollView.contentOffset.y); 94 | [self.scrollView setContentOffset:newOffset animated:YES]; 95 | } 96 | 97 | - (void)resetSubViewsFrame{ 98 | for (NSInteger i = 0; i < [self.contentViews count]; i++) { 99 | UIView *view = [self.contentViews objectAtIndex:i]; 100 | [view setFrame:CGRectMake(CGRectGetWidth(self.bounds) * i, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; 101 | } 102 | if ([self.contentViews count] > 1) { 103 | UIView *currentView = [self.contentViews objectAtIndex:1]; 104 | NSInteger currentPage = currentView.tag; 105 | [self.pageControl setCurrentPage:currentPage]; 106 | } 107 | } 108 | 109 | - (void)rorateViewsRight{ 110 | UIView *lastView = [self.contentViews lastObject]; 111 | [self.contentViews removeLastObject]; 112 | [self.contentViews insertObject:lastView atIndex:0]; 113 | [self resetSubViewsFrame]; 114 | } 115 | 116 | - (void)rorateViewsLeft{ 117 | UIView *firstView = [self.contentViews firstObject]; 118 | [self.contentViews removeObjectAtIndex:0]; 119 | [self.contentViews addObject:firstView]; 120 | [self resetSubViewsFrame]; 121 | } 122 | 123 | - (void)onPageTaped:(UITapGestureRecognizer *)reconnizer{ 124 | UIView *tapedView = reconnizer.view; 125 | if ([self.slideDelegate respondsToSelector:@selector(goAutoSlideView:didTapViewPage:)]) { 126 | [self.slideDelegate goAutoSlideView:self didTapViewPage:tapedView.tag]; 127 | } 128 | } 129 | 130 | #pragma mark Public 131 | - (void)reloadData{ 132 | [self stopAutoScroll]; 133 | [self.scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; 134 | [self.contentViews removeAllObjects]; 135 | if ([self.slideDataSource respondsToSelector:@selector(numberOfPagesInGoAutoSlideView:)]) { 136 | NSInteger pageCount = [self.slideDataSource numberOfPagesInGoAutoSlideView:self]; 137 | 138 | for (NSInteger i = 0; i < pageCount; i++) { 139 | if ([self.slideDataSource respondsToSelector:@selector(goAutoSlideView:viewAtPage:)]) { 140 | UIView *pageView = [self.slideDataSource goAutoSlideView:self viewAtPage:i]; 141 | NSAssert(pageView != nil, @"page view can not be nil!"); 142 | [pageView setUserInteractionEnabled:YES]; 143 | UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onPageTaped:)]; 144 | [pageView addGestureRecognizer:tapRecognizer]; 145 | [pageView setTag:i]; 146 | [self.contentViews addObject:pageView]; 147 | [self.scrollView addSubview:pageView]; 148 | } 149 | } 150 | if (pageCount > 1) { 151 | [self.scrollView setContentSize:CGSizeMake(CGRectGetWidth(self.bounds) * 3, CGRectGetHeight(self.bounds))]; 152 | [self.scrollView setContentOffset:CGPointMake(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; 153 | [self rorateViewsRight]; 154 | }else if(pageCount == 1){ 155 | [self.scrollView setContentSize:self.bounds.size]; 156 | [self.scrollView setContentOffset:CGPointMake(0, CGRectGetHeight(self.bounds))]; 157 | UIView *view = [self.contentViews firstObject]; 158 | [view setFrame:self.bounds]; 159 | } 160 | } 161 | 162 | [self resetPageControl]; 163 | [self startAutoScroll]; 164 | } 165 | 166 | - (void)setSlideDuration:(NSTimeInterval)slideDuration{ 167 | NSAssert(slideDuration > 0, @"slideDuration must be greater than 0"); 168 | _slideDuration = slideDuration; 169 | if (self.slideTimer != nil) { 170 | [self.slideTimer invalidate]; 171 | self.slideTimer = nil; 172 | } 173 | self.slideTimer = [NSTimer scheduledTimerWithTimeInterval:self.slideDuration 174 | target:self 175 | selector:@selector(onTimerFired) 176 | userInfo:nil 177 | repeats:YES]; 178 | } 179 | 180 | - (void)setDisablePageIndicator:(BOOL)disablePageIndicator{ 181 | _disablePageIndicator = disablePageIndicator; 182 | [self resetPageControl]; 183 | } 184 | 185 | - (void)startAutoScroll{ 186 | if ([self.slideTimer isValid] && [self.contentViews count] > 1) { 187 | [self.slideTimer setFireDate:[NSDate dateWithTimeInterval:[self slideDuration] 188 | sinceDate:[NSDate date]]]; 189 | } 190 | } 191 | 192 | - (void)stopAutoScroll{ 193 | if ([self.slideTimer isValid]) { 194 | [self.slideTimer setFireDate:[NSDate distantFuture]]; 195 | } 196 | } 197 | 198 | #pragma mark UIScrollViewDelegate 199 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{ 200 | [self stopAutoScroll]; 201 | } 202 | 203 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ 204 | [self startAutoScroll]; 205 | } 206 | 207 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ 208 | if ([self.contentViews count] > 1) { 209 | if ([self.contentViews count] == 2) { 210 | if (scrollView.contentOffset.x > CGRectGetWidth(self.bounds)) { 211 | UIView *nextView = (UIView *)[self.contentViews firstObject]; 212 | [nextView setFrame:CGRectMake(2 * CGRectGetWidth(self.bounds), 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; 213 | } else if (scrollView.contentOffset.x < CGRectGetWidth(self.bounds)) { 214 | UIView *nextView = (UIView *)[self.contentViews firstObject]; 215 | [nextView setFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; 216 | } 217 | } 218 | if (scrollView.contentOffset.x == 0) { 219 | CGPoint newOffset = CGPointMake(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); 220 | [self.scrollView setContentOffset:newOffset]; 221 | [self rorateViewsRight]; 222 | }else if(scrollView.contentOffset.x == CGRectGetWidth(self.bounds) * 2){ 223 | CGPoint newOffset = CGPointMake(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); 224 | [self.scrollView setContentOffset:newOffset]; 225 | [self rorateViewsLeft]; 226 | } 227 | } 228 | scrollView.contentOffset = CGPointMake(scrollView.contentOffset.x, 0); 229 | } 230 | 231 | @end 232 | -------------------------------------------------------------------------------- /Example/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleIdentifier 7 | $(PRODUCT_BUNDLE_IDENTIFIER) 8 | CFBundleInfoDictionaryVersion 9 | 6.0 10 | CFBundleSignature 11 | ???? 12 | 13 | CFBundleExecutable 14 | $(EXECUTABLE_NAME) 15 | 16 | CFBundleName 17 | $(PRODUCT_NAME) 18 | 19 | CFBundleDevelopmentRegion 20 | en 21 | 22 | CFBundleShortVersionString 23 | 1.0 24 | CFBundleVersion 25 | 1 26 | 27 | CFBundlePackageType 28 | APPL 29 | 30 | LSRequiresIPhoneOS 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UILaunchStoryboardName 37 | LaunchScreen 38 | 39 | UISupportedInterfaceOrientations 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationLandscapeLeft 43 | UIInterfaceOrientationLandscapeRight 44 | 45 | UIMainStoryboardFile 46 | Main 47 | 48 | -------------------------------------------------------------------------------- /Example/Example/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Example 4 | // 5 | // Created by jamie on 16/3/9. 6 | // Copyright (c) 2016 X-Monster. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | 13 | @interface ViewController : UIViewController 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Example/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // GoAutoSlideViewExample 4 | // 5 | // Created by jamie on 16/3/9. 6 | // Copyright (c) 2016 X-Monster. All rights reserved. 7 | // 8 | 9 | 10 | #import "ViewController.h" 11 | #import "GoAutoSlideView.h" 12 | 13 | 14 | @interface ViewController () 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | [self initView]; 24 | } 25 | 26 | - (void)initView{ 27 | GoAutoSlideView *slideView = [[GoAutoSlideView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 300)]; 28 | slideView.slideDuration = 5; 29 | slideView.slideDelegate = self; 30 | slideView.slideDataSource = self; 31 | slideView.pageIndicatorColor = [UIColor grayColor]; 32 | slideView.currentPageIndicatorColor = [UIColor blueColor]; 33 | [self.view addSubview:slideView]; 34 | [slideView reloadData]; 35 | } 36 | 37 | - (void)didReceiveMemoryWarning { 38 | [super didReceiveMemoryWarning]; 39 | // Dispose of any resources that can be recreated. 40 | } 41 | 42 | #pragma mark GoAutoSlideViewDataSource 43 | 44 | - (NSInteger)numberOfPagesInGoAutoSlideView:(GoAutoSlideView *)goAutoSlideView { 45 | return 5; 46 | } 47 | 48 | - (UIView *)goAutoSlideView:(GoAutoSlideView *)goAutoSlideView viewAtPage:(NSInteger)page { 49 | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([UIScreen mainScreen].bounds), 300)]; 50 | CGFloat hue = (CGFloat) ( arc4random() % 256 / 256.0 ); 51 | CGFloat saturation = (CGFloat) (( arc4random() % 128 / 256.0 ) + 0.5); 52 | CGFloat brightness = (CGFloat) (( arc4random() % 128 / 256.0 ) + 0.5); 53 | UIColor *randomColor = [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1]; 54 | [view setBackgroundColor:randomColor]; 55 | return view; 56 | } 57 | #pragma mark GoAutoSlideViewDelegate 58 | 59 | - (void)goAutoSlideView:(GoAutoSlideView *)goAutoSlideView didTapViewPage:(NSInteger)page { 60 | NSLog(@"Page %@ taped", @(page)); 61 | } 62 | 63 | @end -------------------------------------------------------------------------------- /Example/Example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Example 4 | // 5 | // Created by jamie on 16/3/9. 6 | // Copyright (c) 2016 X-Monster. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import "AppDelegate.h" 12 | 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /Example/ExampleTests/ExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleTests.m 3 | // ExampleTests 4 | // 5 | // Created by jamie on 16/3/9. 6 | // Copyright (c) 2016 X-Monster. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ExampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ExampleTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Example/ExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleIdentifier 7 | $(PRODUCT_BUNDLE_IDENTIFIER) 8 | CFBundleInfoDictionaryVersion 9 | 6.0 10 | CFBundleSignature 11 | ???? 12 | 13 | CFBundleExecutable 14 | $(EXECUTABLE_NAME) 15 | 16 | CFBundleName 17 | $(PRODUCT_NAME) 18 | 19 | CFBundleDevelopmentRegion 20 | en 21 | 22 | CFBundleShortVersionString 23 | 1.0 24 | CFBundleVersion 25 | 1 26 | 27 | CFBundlePackageType 28 | BNDL 29 | 30 | 31 | -------------------------------------------------------------------------------- /Example/ExampleUITests/ExampleUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleUITests.m 3 | // ExampleUITests 4 | // 5 | // Created by jamie on 16/3/9. 6 | // Copyright (c) 2016 X-Monster. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ExampleUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ExampleUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Example/ExampleUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleIdentifier 7 | $(PRODUCT_BUNDLE_IDENTIFIER) 8 | CFBundleInfoDictionaryVersion 9 | 6.0 10 | CFBundleSignature 11 | ???? 12 | 13 | CFBundleExecutable 14 | $(EXECUTABLE_NAME) 15 | 16 | CFBundleName 17 | $(PRODUCT_NAME) 18 | 19 | CFBundleDevelopmentRegion 20 | en 21 | 22 | CFBundleShortVersionString 23 | 1.0 24 | CFBundleVersion 25 | 1 26 | 27 | CFBundlePackageType 28 | BNDL 29 | 30 | 31 | -------------------------------------------------------------------------------- /GoAutoSlideView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint GoAutoSlideView.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "GoAutoSlideView" 19 | s.version = "1.0" 20 | s.summary = "GoAutoSlideView extends UIScrollView by featuring infinitely and automatically slide." 21 | 22 | # This description is used to generate tags and improve search results. 23 | # * Think: What does it do? Why did you write it? What is the focus? 24 | # * Try to keep it short, snappy and to the point. 25 | # * Write the description between the DESC delimiters below. 26 | # * Finally, don't worry about the indent, CocoaPods strips it! 27 | s.description = <<-DESC 28 | GoAutoSlideView which is well documented has neat APIs to implement infinite and automatically slide. 29 | DESC 30 | 31 | s.homepage = "https://github.com/zjmdp/GoAutoSlideView" 32 | #s.screenshots = "https://github.com/zjmdp/GoAutoSlideView/blob/master/screenshot/screenshot.gif" 33 | 34 | 35 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 36 | # 37 | # Licensing your code is important. See http://choosealicense.com for more info. 38 | # CocoaPods will detect a license file if there is a named LICENSE* 39 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 40 | # 41 | 42 | s.license = "MIT (LICENSE)" 43 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 44 | 45 | 46 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 47 | # 48 | # Specify the authors of the library, with email addresses. Email addresses 49 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 50 | # accepts just a name if you'd rather not provide an email address. 51 | # 52 | # Specify a social_media_url where others can refer to, for example a twitter 53 | # profile URL. 54 | # 55 | 56 | s.author = { "zjmdp" => "modapeng@gmail.com" } 57 | # Or just: s.author = "zjmdp" 58 | # s.authors = { "zjmdp" => "modapeng@gmail.com" } 59 | # s.social_media_url = "http://twitter.com/zjmdp" 60 | 61 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 62 | # 63 | # If this Pod runs only on iOS or OS X, then specify the platform and 64 | # the deployment target. You can optionally include the target after the platform. 65 | # 66 | 67 | # s.platform = :ios 68 | s.platform = :ios, "7.0" 69 | 70 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 71 | # 72 | # Specify the location from where the source should be retrieved. 73 | # Supports git, hg, bzr, svn and HTTP. 74 | # 75 | 76 | s.source = { :git => "https://github.com/zjmdp/GoAutoSlideView.git", :tag => "1.0" } 77 | 78 | 79 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 80 | # 81 | # CocoaPods is smart about how it includes source code. For source files 82 | # giving a folder will include any swift, h, m, mm, c & cpp files. 83 | # For header files it will include any header in the folder. 84 | # Not including the public_header_files will make all headers public. 85 | # 86 | 87 | s.source_files = "Classes", "Classes/**/*.{h,m}" 88 | s.exclude_files = "Classes/Exclude" 89 | 90 | # s.public_header_files = "Classes/**/*.h" 91 | 92 | 93 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 94 | # 95 | # A list of resources included with the Pod. These are copied into the 96 | # target bundle with a build phase script. Anything else will be cleaned. 97 | # You can preserve files from being cleaned, please don't preserve 98 | # non-essential files like tests, examples and documentation. 99 | # 100 | 101 | # s.resource = "icon.png" 102 | # s.resources = "Resources/*.png" 103 | 104 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 105 | 106 | 107 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 108 | # 109 | # Link your library with frameworks, or libraries. Libraries do not include 110 | # the lib prefix of their name. 111 | # 112 | 113 | # s.framework = "SomeFramework" 114 | # s.frameworks = "SomeFramework", "AnotherFramework" 115 | 116 | # s.library = "iconv" 117 | # s.libraries = "iconv", "xml2" 118 | 119 | 120 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 121 | # 122 | # If your library depends on compiler flags you can set them in the xcconfig hash 123 | # where they will only apply to your library. If you depend on other Podspecs 124 | # you can include multiple dependencies to ensure it works. 125 | 126 | # s.requires_arc = true 127 | 128 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 129 | # s.dependency "JSONKit", "~> 1.4" 130 | 131 | end 132 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 modapeng@gmail.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GoAutoSlideView 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/GoAutoSlideView.svg?style=flat)](http://cocoapods.org/pods/GoAutoSlideView) 4 | [![License](https://img.shields.io/cocoapods/l/GoAutoSlideView.svg?style=flat)](http://cocoapods.org/pods/GoAutoSlideView) 5 | [![Platform](https://img.shields.io/cocoapods/p/GoAutoSlideView.svg?style=flat)](http://cocoapods.org/pods/GoAutoSlideView) 6 | 7 | 8 | `GoAutoSlideView` extends `UIScrollView` by featuring *infinitely* and *automatically* slide. 9 | 10 | #ScreenShot 11 | ![Screenshot](./Screenshots/screenshot.gif "screenshot") 12 | 13 | ## Installation 14 | ###CocoaPods 15 | ```ruby 16 | 17 | pod 'GoAutoSlideView', '~> 0.7' 18 | 19 | ``` 20 | 21 | ###Manually 22 | 1. Downloads the source files in directory `GoAutoSlideView/Classes`. 23 | 2. Add the source files to your project. 24 | 3. import `"GoAutoSlideView.h"` in your files. 25 | 26 | ## Usage 27 | #### Create GoAutoSlideView 28 | 29 | ```objc 30 | 31 | GoAutoSlideView *slideView = [[GoAutoSlideView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 250)]; 32 | slideView.slideDuration = 5; 33 | slideView.slideDelegate = self; 34 | slideView.slideDataSource = self; 35 | slideView.currentPageIndicatorColor = [UIColor blueColor]; 36 | [self.view addSubView:slideView]; 37 | [slideView reloadData]; 38 | 39 | ``` 40 | 41 | #### Implement GoSlideViewDataSource 42 | 43 | ```objc 44 | 45 | - (NSInteger)numberOfPagesInGoAutoSlideView:(GoAutoSlideView *)goAutoSlideView{ 46 | return 5; 47 | } 48 | 49 | - (UIView *)goAutoSlideView:(GoAutoSlideView *)goAutoSlideView viewAtPage:(NSInteger)page{ 50 | UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 250)]; 51 | [image setImage:[UIImage imageNamed:images[page]]] 52 | return imageView; 53 | } 54 | 55 | ``` 56 | 57 | #### Implement GoSlideViewDelegate 58 | 59 | ```objc 60 | 61 | - (void)goAutoSlideView:(GoAutoSlideView *)goAutoSlideView didTapViewPage:(NSInteger)page{ 62 | NSLog(@"didTapViewPage at index: %@", @(page)); 63 | } 64 | 65 | ``` 66 | 67 | ## Contributing 68 | 69 | 1. Fork it! 70 | 2. Create your feature branch: `git checkout -b my-new-feature` 71 | 3. Commit your changes: `git commit -am 'Add some feature'` 72 | 4. Push to the branch: `git push origin my-new-feature` 73 | 5. Submit a pull request :D 74 | 75 | ## Credits 76 | 77 | * zjmdp 78 | 79 | ## License 80 | 81 | MIT license 82 | -------------------------------------------------------------------------------- /Screenshots/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjmdp/GoAutoSlideView/199e4a96db6d6fa541e1c2f2c981a39a57c9ed24/Screenshots/screenshot.gif --------------------------------------------------------------------------------