Import project

This commit is contained in:
Looping 2014-09-22 15:06:32 +08:00
parent f0272b105c
commit dba59d1394
19 changed files with 1469 additions and 8 deletions

24
.gitignore vendored
View File

@ -1,5 +1,17 @@
# Created by http://www.gitignore.io
### Xcode ###
build
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcworkspace/contents.xcworkspacedata
### Objective-C ###
# OS X
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
@ -11,16 +23,12 @@ build/
!default.perspectivev3
xcuserdata
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Pods/
Pods
*.xcworkspace

19
RCPageControl.podspec Normal file
View File

@ -0,0 +1,19 @@
Pod::Spec.new do |s|
s.name = "RCPageControl"
s.version = "0.1"
s.summary = "Yet another page control for iOS, with awesome animation powered by facebook pop library and highly customizable UI."
s.homepage = "https://github.com/RidgeCorn/RCPageControl"
s.license = { :type => "MIT", :file => "LICENSE" }
s.authors = { "Looping" => "www.looping@gmail.com" }
s.platform = :ios, '6.0'
s.ios.deployment_target = '6.0'
s.source = { :git => "https://github.com/RidgeCorn/RCPageControl.git", :tag => s.version.to_s }
s.source_files = 'RCPageControl'
s.public_header_files = 'RCPageControl/*.h'
s.requires_arc = true
s.dependency 'pop'
end

View File

@ -0,0 +1,74 @@
//
// RCPageControl.h
// RCPageControlExample
//
// Created by Looping on 14/9/15.
// Copyright (c) 2014 RidgeCorn. All rights reserved.
//
/**
The MIT License (MIT)
Copyright (c) 2014 RidgeCorn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#import <UIKit/UIKit.h>
@class RCPageControl;
typedef void (^RCCurrentPageChangedBlock)(RCPageControl *pageControl);
@interface RCPageControl : UIControl
@property (nonatomic) NSInteger numberOfPages; // default is 0
@property (nonatomic) NSInteger currentPage; // default is 0. value pinned to 0 .. numberOfPages-1
@property (nonatomic) CGFloat indicatorDotGap; // default is 10.f, min value is 2.f
@property (nonatomic) CGFloat indicatorDotWidth; // default is 4.f, min value is 2.f
@property (nonatomic) CGFloat animationSpeed; // default is 8.f
@property (nonatomic) CGFloat animationBounciness; // default is 12.f
@property (nonatomic) CGFloat animationDuration; // default is .6f
@property (nonatomic) NSInteger animationScaleFactor; // default is 2
@property (nonatomic) BOOL hidesForSinglePage; // hide the indicator if there is only one page, default is NO
@property (nonatomic) BOOL defersCurrentPageDisplay; // if set, clicking to a new page won't update the currently displayed page until -updateCurrentPageDisplay is called, default is NO
@property (nonatomic) BOOL hideCurrentPageIndex; // hide the indicator dot index display label, default is NO
@property (nonatomic) BOOL disableAnimation; // disable all the indicator dot changing animation, default is NO
@property(nonatomic) UIColor *pageIndicatorTintColor; // default is [UIColor lightTextColor]
@property(nonatomic) UIColor *currentPageIndicatorTintColor; // default is [UIColor whiteColor]
@property(nonatomic) UIColor *currentPageIndexTextTintColor; // default is [UIColor darkTextColor]
@property(nonatomic) UIFont *currentPageIndexTextFont; // default is [UIFont systemFontOfSize:0], the font size is automatically adjusts by the value of indicatorDotWidth and animationScaleFactor
@property (nonatomic, copy) RCCurrentPageChangedBlock currentPageChanged; // if set, -sendActionsForControlEvents will never be called, only available for 'Touch Event' in page control, it also means you need to set non-zero frame for page control to activate 'Touch Event'
- (instancetype)initWithNumberOfPages:(NSInteger)pages; // if you want 'currentPageChanged' block available, call -setFrame: after initialization
- (void)updateCurrentPageDisplay; // update page display to match the currentPage, ignored if defersCurrentPageDisplay is NO, setting the page value directly will update immediately
- (CGSize)sizeForNumberOfPages:(NSInteger)pageCount; // returns size required to display dots for given page count. can be used to size control if page count could change
- (CGPoint)positionForNumberOfPages:(NSInteger)pageCount; // returns position to display dots for defined control frame and given page count. can be used to size control if control frame or page count could change
- (void)switchToPage:(NSInteger)page progress:(CGFloat)progress; // default page animation progress is 1.f, value is between (0.01f 1.f]
@end

View File

@ -0,0 +1,440 @@
//
// RCPageControl.m
// RCPageControlExample
//
// Created by Looping on 14/9/15.
// Copyright (c) 2014 RidgeCorn. All rights reserved.
//
/**
The MIT License (MIT)
Copyright (c) 2014 RidgeCorn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#import "RCPageControl.h"
#import <POP.h>
#define RCDefaultIndicatorDotBaseTag 1009
#define RCDefaultIndicatorDotGapMinValue 2.f
#define RCDefaultIndicatorDotWidthMinValue 2.f
#define RCDefaultIndicatorDotAnimationDurationMinValue 0.01f
#define RCDefaultIndicatorDotScaleFactorMinValue 0
#define RCDefaultIndicatorDotIndexDisplayMinWidth 8.f
#define RCDefaultIndicatorDotChangeProgressMaxValue 1.f
#define RCDefaultIndicatorDotChangeProgressMinValue .01f
#define RCDefaultIndicatorScaleAnimationKey @"RCPageControlIndicatorScaleAnimation"
#define RCDefaultIndicatorColorAnimationKey @"RCPageControlIndicatorColorAnimation"
#define IsFloatZero(A) fabsf(A) < FLT_EPSILON
#define IsFloatEqualToFloat(A, B) IsFloatZero((A) - (B))
@interface RCPageControl ()
@property (nonatomic) NSInteger currentDisplayedPage;
@property (nonatomic) NSInteger previousDisplayPage;
@property (nonatomic) UILabel *indicatorIndexLabel;
@end
@implementation RCPageControl
#pragma mark - Initialization
- (instancetype)init {
return [self initWithFrame:CGRectZero];
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self commConfig];
}
return self;
}
- (instancetype)initWithNumberOfPages:(NSInteger)pages {
RCPageControl *pageControl = [self init];
if (pageControl) {
[pageControl setNumberOfPages:pages];
}
return pageControl;
}
- (void)awakeFromNib {
[self commConfig];
}
- (void)commConfig {
_currentDisplayedPage = 0;
_previousDisplayPage = 0;
_numberOfPages = 0;
_currentPage = 0;
_indicatorDotGap = 10.f;
_indicatorDotWidth = 4.f;
_animationSpeed = 8.f;
_animationBounciness = 12.f;
_animationDuration = .6f;
_animationScaleFactor = 2;
_hidesForSinglePage = NO;
_defersCurrentPageDisplay = NO;
_hideCurrentPageIndex = NO;
_disableAnimation = NO;
_pageIndicatorTintColor = [UIColor lightTextColor];
_currentPageIndicatorTintColor = [UIColor whiteColor];
_currentPageIndexTextTintColor = [UIColor darkTextColor];
_currentPageIndexTextFont = [UIFont systemFontOfSize:0];
[self loadIndicatorIndexLabel];
[self setBackgroundColor:[UIColor clearColor]];
}
- (void)loadIndicatorIndexLabel {
CGFloat width = MAX(RCDefaultIndicatorDotIndexDisplayMinWidth, [self _scaledDotMaxWidth]);
if (_indicatorIndexLabel) {
[_indicatorIndexLabel setFrame:CGRectMake(0, 0, width, width)];
} else {
_indicatorIndexLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, width)];
[_indicatorIndexLabel setTextAlignment:NSTextAlignmentCenter];
[_indicatorIndexLabel setBackgroundColor:[UIColor clearColor]];
}
[_indicatorIndexLabel setTextColor:_currentPageIndexTextTintColor];
[_indicatorIndexLabel setFont:[_currentPageIndexTextFont fontWithSize:[self _scaledDotMaxWidth] * 2 / 3]];
[_indicatorIndexLabel setHidden:_hideCurrentPageIndex];
UIView *dot = [self _currentDisplayedDot];
if (dot) {
[_indicatorIndexLabel setCenter:dot.center];
} else {
[_indicatorIndexLabel setHidden:YES];
}
}
#pragma mark - Properties
- (void)setNumberOfPages:(NSInteger)numberOfPages {
if (numberOfPages >= 0 && numberOfPages != _numberOfPages) {
_numberOfPages = numberOfPages;
[self _refreshIndicator:YES];
}
}
- (void)setCurrentPage:(NSInteger)currentPage forceRefresh:(BOOL)forceRefresh {
_previousDisplayPage = _currentPage;
_currentPage = MIN(MAX(0, currentPage), _numberOfPages - 1);
if ( !self.defersCurrentPageDisplay || forceRefresh) {
_currentDisplayedPage = _currentPage;
[self _animateIndicator:forceRefresh];
}
}
- (void)setCurrentPage:(NSInteger)currentPage {
[self setCurrentPage:currentPage forceRefresh:NO];
}
- (void)setIndicatorDotGap:(CGFloat)indicatorDotGap {
CGFloat gap = MAX(RCDefaultIndicatorDotGapMinValue, indicatorDotGap);
if ( !IsFloatEqualToFloat(_indicatorDotGap, gap)) {
_indicatorDotGap = gap;
[self _refreshIndicator:YES];
}
}
- (void)setIndicatorDotWidth:(CGFloat)indicatorDotWidth {
CGFloat width = MAX(RCDefaultIndicatorDotWidthMinValue, indicatorDotWidth);
if ( !IsFloatEqualToFloat(_indicatorDotWidth, width)) {
_indicatorDotWidth = width;
[self loadIndicatorIndexLabel];
[self _refreshIndicator:YES];
}
}
- (void)setAnimationScaleFactor:(NSInteger)animationScaleFactor {
if ( _animationScaleFactor != animationScaleFactor) {
_animationScaleFactor = MAX(RCDefaultIndicatorDotScaleFactorMinValue, animationScaleFactor);
[self loadIndicatorIndexLabel];
[self _dotScaleAnimationAtIndex:_currentDisplayedPage withProgress:RCDefaultIndicatorDotChangeProgressMaxValue];
}
}
- (void)setFrame:(CGRect)frame {
if ( !CGRectEqualToRect(self.frame, frame)) {
[super setFrame:frame];
[self _refreshIndicator:YES];
NSLog(@"%@, %@", NSStringFromCGRect(self.frame), NSStringFromCGRect(super.frame));
}
}
- (void)setHidesForSinglePage:(BOOL)hidesForSinglePage {
if (_hidesForSinglePage != hidesForSinglePage) {
_hidesForSinglePage = hidesForSinglePage;
[self _refreshIndicator:YES];
}
}
- (void)setHideCurrentPageIndex:(BOOL)hideCurrentPageIndex {
if (_hideCurrentPageIndex != hideCurrentPageIndex) {
_hideCurrentPageIndex = hideCurrentPageIndex;
[self loadIndicatorIndexLabel];
}
}
- (void)setPageIndicatorTintColor:(UIColor *)pageIndicatorTintColor {
if ( ![_pageIndicatorTintColor isEqual:pageIndicatorTintColor]) {
_pageIndicatorTintColor = pageIndicatorTintColor;
[self _refreshIndicator:YES];
}
}
- (void)setCurrentPageIndicatorTintColor:(UIColor *)currentPageIndicatorTintColor {
if ( ![_currentPageIndicatorTintColor isEqual:currentPageIndicatorTintColor]) {
_currentPageIndicatorTintColor = currentPageIndicatorTintColor;
[self _dotColorAnimationAtIndex:_currentDisplayedPage withProgress:RCDefaultIndicatorDotChangeProgressMaxValue];
}
}
- (void)setCurrentPageIndexTintColor:(UIColor *)currentPageIndexTintColor {
if ( ![_currentPageIndexTextTintColor isEqual:currentPageIndexTintColor]) {
_currentPageIndexTextTintColor = currentPageIndexTintColor;
[self loadIndicatorIndexLabel];
}
}
- (void)setCurrentPageIndexTextFont:(UIFont *)currentPageIndexTextFont {
if ( ![_currentPageIndexTextFont isEqual:currentPageIndexTextFont]) {
_currentPageIndexTextFont = currentPageIndexTextFont;
[self loadIndicatorIndexLabel];
}
}
#pragma mark - Touch Event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if ([[touches anyObject] locationInView:self].x < [self positionForNumberOfPages:self.numberOfPages].x + [self sizeForNumberOfPages:self.currentDisplayedPage + 1].width - _indicatorDotWidth / 2) {
[self setCurrentPage:self.currentPage - 1 forceRefresh:NO];
} else {
[self setCurrentPage:self.currentPage + 1 forceRefresh:NO];
}
if (_currentPageChanged) {
_currentPageChanged(self);
} else {
[self sendActionsForControlEvents:UIControlEventValueChanged];
}
}
#pragma mark - Public Methods
#pragma mark Frame Helper
- (CGSize)sizeForNumberOfPages:(NSInteger)pageCount {
return CGSizeMake((_indicatorDotGap + _indicatorDotWidth) * pageCount - _indicatorDotGap, _indicatorDotWidth);
}
- (CGPoint)positionForNumberOfPages:(NSInteger)pageCount {
return CGPointMake((self.frame.size.width - (_indicatorDotGap + _indicatorDotWidth) * pageCount + _indicatorDotGap) / 2, (self.frame.size.height - _indicatorDotWidth) / 2);
}
#pragma mark Page Update
- (void)updateCurrentPageDisplay {
_currentDisplayedPage = _currentPage;
[self _animateIndicator:NO];
}
- (void)switchToPage:(NSInteger)page progress:(CGFloat)progress {
[self _animationFromPage:_currentDisplayedPage toPage:page withProgress:progress];
}
#pragma mark - Private Methods
#pragma mark Common
- (NSInteger)_dotTagAtIndex:(NSInteger )index {
return RCDefaultIndicatorDotBaseTag * (index + 1);
}
- (UIView *)_dotAtIndex:(NSInteger)index {
return [self viewWithTag:[self _dotTagAtIndex:index]];
}
- (UIView *)_previousDisplayDot {
return [self _dotAtIndex:_previousDisplayPage];
}
- (UIView *)_currentDisplayedDot {
return [self _dotAtIndex:_currentDisplayedPage];
}
- (CGFloat)_scaledDotMaxWidth {
return _indicatorDotWidth * (1 + _animationScaleFactor);
}
#pragma mark Indicator Animation
- (void)_dotScaleAnimationAtIndex:(NSInteger)index toValue:(id)toValue {
UIView *dot = [self _dotAtIndex:index];
[dot pop_removeAnimationForKey:RCDefaultIndicatorScaleAnimationKey];
POPPropertyAnimation *animation;
if (_disableAnimation) {
animation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewScaleXY];
((POPBasicAnimation *)animation).duration = RCDefaultIndicatorDotAnimationDurationMinValue;
} else {
animation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewScaleXY];
((POPSpringAnimation *)animation).springSpeed = _animationSpeed;
((POPSpringAnimation *)animation).springBounciness = _animationBounciness;
}
[animation setRemovedOnCompletion:YES];
animation.toValue = toValue;
[dot pop_addAnimation:animation forKey:RCDefaultIndicatorScaleAnimationKey];
}
- (void)_dotColorAnimationAtIndex:(NSInteger)index toValue:(id)toValue {
UIView *dot = [self _dotAtIndex:index];
[dot pop_removeAnimationForKey:RCDefaultIndicatorColorAnimationKey];
POPBasicAnimation *animation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewBackgroundColor];
[animation setRemovedOnCompletion:YES];
animation.toValue = toValue;
animation.duration = _disableAnimation ? RCDefaultIndicatorDotAnimationDurationMinValue : _animationDuration;
[dot pop_addAnimation:animation forKey:RCDefaultIndicatorColorAnimationKey];
}
- (void)_dotScaleAnimationAtIndex:(NSInteger)index withProgress:(CGFloat)progress {
[self _dotScaleAnimationAtIndex:index toValue:[NSValue valueWithCGPoint:CGPointMake(1.f + _animationScaleFactor * progress, 1.f +_animationScaleFactor * progress)]];
}
- (void)_dotColorAnimationAtIndex:(NSInteger)index withProgress:(CGFloat)progress {
[self _dotColorAnimationAtIndex:index toValue:(index == _currentDisplayedPage) ? _currentPageIndicatorTintColor : _pageIndicatorTintColor];
}
- (void)_animationFromPage:(NSInteger)fromPage toPage:(NSInteger)toPage withProgress:(CGFloat)progress {
if (toPage >= 0 && fromPage >= 0) {
[self _dotScaleAnimationAtIndex:fromPage withProgress:1 - progress];
[self _dotScaleAnimationAtIndex:toPage withProgress:progress];
[self _dotColorAnimationAtIndex:fromPage withProgress:1 - progress];
[self _dotColorAnimationAtIndex:toPage withProgress:progress];
BOOL hidden = ![self _dotAtIndex:toPage] || ([self _scaledDotMaxWidth] < RCDefaultIndicatorDotIndexDisplayMinWidth) || (progress < 1 - RCDefaultIndicatorDotChangeProgressMinValue) || _hideCurrentPageIndex;
[_indicatorIndexLabel setHidden:hidden];
if ( !hidden) {
[self bringSubviewToFront:_indicatorIndexLabel];
[_indicatorIndexLabel setCenter:[self _dotAtIndex:toPage].center];
[_indicatorIndexLabel setText:[NSString stringWithFormat:@"%d", toPage + 1]];
[_indicatorIndexLabel setAlpha:.3f];
[UIView animateWithDuration:_disableAnimation ? 0 : _animationDuration animations:^{
[_indicatorIndexLabel setAlpha:1.f];
}];
}
}
}
- (void)_animateIndicator:(BOOL)forceAnimate {
if (forceAnimate || _previousDisplayPage != _currentDisplayedPage) {
[self _animationFromPage:_previousDisplayPage toPage:_currentDisplayedPage withProgress:1.f];
}
}
#pragma mark Indicator Refresh
- (void)_refreshIndicator:(BOOL)forceRefresh {
if ( !(_hidesForSinglePage && _numberOfPages <= 1)) {
[self setHidden:NO];
if (forceRefresh || self.subviews.count != _numberOfPages) {
CGPoint position = [self positionForNumberOfPages:self.numberOfPages];
NSInteger index = 0;
for (; index < _numberOfPages; index ++) {
CGRect frame = CGRectMake(position.x + index * (_indicatorDotGap + _indicatorDotWidth), position.y, _indicatorDotWidth, _indicatorDotWidth);
UIView *dot = [self _dotAtIndex:index] ?: [[UIView alloc] initWithFrame:frame];
[dot setTag:[self _dotTagAtIndex:index]];
[dot setBackgroundColor:_pageIndicatorTintColor];
[dot.layer setMasksToBounds:YES];
[dot.layer setCornerRadius:dot.frame.size.height / 2];
if ( !dot.superview) {
[self addSubview:dot];
} else {
[dot setFrame:frame];
}
}
for (; self.subviews.count && index < self.subviews.count - 1; index ++) {
[[self _dotAtIndex:index] removeFromSuperview];
}
[self _animateIndicator:forceRefresh];
}
if ( !_indicatorIndexLabel.superview) {
[self addSubview:_indicatorIndexLabel];
}
[self bringSubviewToFront:_indicatorIndexLabel];
} else {
[self setHidden:YES];
}
}
@end

View File

@ -0,0 +1,5 @@
platform :ios, '6.0'
pod 'pop'
pod 'iCarousel'
pod 'RCPageControl', :path => '../'

View File

@ -0,0 +1,21 @@
PODS:
- iCarousel (1.8)
- pop (1.0.6)
- RCPageControl (0.1):
- pop
DEPENDENCIES:
- iCarousel
- pop
- RCPageControl (from `../`)
EXTERNAL SOURCES:
RCPageControl:
:path: ../
SPEC CHECKSUMS:
iCarousel: cf77aea48dfcde9a0cd85569a1d8a9b6dd543bd7
pop: e518794da38942c05255eb64b36d894e70cb4f00
RCPageControl: a2c06b0f3ca78ff600d7459c7ba8f996b36b0a20
COCOAPODS: 0.33.1

View File

@ -0,0 +1,482 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
6E2F733B19C72600008985F7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E2F733A19C72600008985F7 /* main.m */; };
6E2F733E19C72600008985F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E2F733D19C72600008985F7 /* AppDelegate.m */; };
6E2F734119C72600008985F7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E2F734019C72600008985F7 /* ViewController.m */; };
6E2F734419C72600008985F7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6E2F734219C72600008985F7 /* Main.storyboard */; };
6E2F734619C72601008985F7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6E2F734519C72601008985F7 /* Images.xcassets */; };
6E2F734919C72601008985F7 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6E2F734719C72601008985F7 /* LaunchScreen.xib */; };
6E2F735519C72601008985F7 /* RCPageControlExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E2F735419C72601008985F7 /* RCPageControlExampleTests.m */; };
D49C37915C534FBF81B1C62C /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E1326DC0F37B4CD9B3DC981C /* libPods.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
6E2F734F19C72601008985F7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6E2F732D19C72600008985F7 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 6E2F733419C72600008985F7;
remoteInfo = RCPageControlExample;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
6E2F733519C72600008985F7 /* RCPageControlExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RCPageControlExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
6E2F733919C72600008985F7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6E2F733A19C72600008985F7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
6E2F733C19C72600008985F7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
6E2F733D19C72600008985F7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
6E2F733F19C72600008985F7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
6E2F734019C72600008985F7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
6E2F734319C72600008985F7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
6E2F734519C72601008985F7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
6E2F734819C72601008985F7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
6E2F734E19C72601008985F7 /* RCPageControlExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RCPageControlExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6E2F735319C72601008985F7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6E2F735419C72601008985F7 /* RCPageControlExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCPageControlExampleTests.m; sourceTree = "<group>"; };
6E55D24919C97C01008E8B03 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
8E717ED8CE5548A48B510212 /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = "<group>"; };
E1326DC0F37B4CD9B3DC981C /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
6E2F733219C72600008985F7 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D49C37915C534FBF81B1C62C /* libPods.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6E2F734B19C72601008985F7 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6E2F732C19C72600008985F7 = {
isa = PBXGroup;
children = (
6E2F733719C72600008985F7 /* RCPageControlExample */,
6E2F735119C72601008985F7 /* RCPageControlExampleTests */,
6E2F733619C72600008985F7 /* Products */,
8E717ED8CE5548A48B510212 /* Pods.xcconfig */,
7C549DD4BE2E4976BC588DB1 /* Frameworks */,
);
sourceTree = "<group>";
};
6E2F733619C72600008985F7 /* Products */ = {
isa = PBXGroup;
children = (
6E2F733519C72600008985F7 /* RCPageControlExample.app */,
6E2F734E19C72601008985F7 /* RCPageControlExampleTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
6E2F733719C72600008985F7 /* RCPageControlExample */ = {
isa = PBXGroup;
children = (
6E2F733C19C72600008985F7 /* AppDelegate.h */,
6E2F733D19C72600008985F7 /* AppDelegate.m */,
6E2F733F19C72600008985F7 /* ViewController.h */,
6E2F734019C72600008985F7 /* ViewController.m */,
6E2F734219C72600008985F7 /* Main.storyboard */,
6E2F734519C72601008985F7 /* Images.xcassets */,
6E2F734719C72601008985F7 /* LaunchScreen.xib */,
6E2F733819C72600008985F7 /* Supporting Files */,
);
path = RCPageControlExample;
sourceTree = "<group>";
};
6E2F733819C72600008985F7 /* Supporting Files */ = {
isa = PBXGroup;
children = (
6E2F733919C72600008985F7 /* Info.plist */,
6E2F733A19C72600008985F7 /* main.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
6E2F735119C72601008985F7 /* RCPageControlExampleTests */ = {
isa = PBXGroup;
children = (
6E2F735419C72601008985F7 /* RCPageControlExampleTests.m */,
6E2F735219C72601008985F7 /* Supporting Files */,
);
path = RCPageControlExampleTests;
sourceTree = "<group>";
};
6E2F735219C72601008985F7 /* Supporting Files */ = {
isa = PBXGroup;
children = (
6E2F735319C72601008985F7 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
7C549DD4BE2E4976BC588DB1 /* Frameworks */ = {
isa = PBXGroup;
children = (
6E55D24919C97C01008E8B03 /* MediaPlayer.framework */,
E1326DC0F37B4CD9B3DC981C /* libPods.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
6E2F733419C72600008985F7 /* RCPageControlExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6E2F735819C72601008985F7 /* Build configuration list for PBXNativeTarget "RCPageControlExample" */;
buildPhases = (
98157623954F4D229D890630 /* Check Pods Manifest.lock */,
6E2F733119C72600008985F7 /* Sources */,
6E2F733219C72600008985F7 /* Frameworks */,
6E2F733319C72600008985F7 /* Resources */,
4205A7A3089C4258B519BEEC /* Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = RCPageControlExample;
productName = RCPageControlExample;
productReference = 6E2F733519C72600008985F7 /* RCPageControlExample.app */;
productType = "com.apple.product-type.application";
};
6E2F734D19C72601008985F7 /* RCPageControlExampleTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6E2F735B19C72601008985F7 /* Build configuration list for PBXNativeTarget "RCPageControlExampleTests" */;
buildPhases = (
6E2F734A19C72601008985F7 /* Sources */,
6E2F734B19C72601008985F7 /* Frameworks */,
6E2F734C19C72601008985F7 /* Resources */,
);
buildRules = (
);
dependencies = (
6E2F735019C72601008985F7 /* PBXTargetDependency */,
);
name = RCPageControlExampleTests;
productName = RCPageControlExampleTests;
productReference = 6E2F734E19C72601008985F7 /* RCPageControlExampleTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
6E2F732D19C72600008985F7 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0600;
ORGANIZATIONNAME = RidgeCorn;
TargetAttributes = {
6E2F733419C72600008985F7 = {
CreatedOnToolsVersion = 6.0;
};
6E2F734D19C72601008985F7 = {
CreatedOnToolsVersion = 6.0;
TestTargetID = 6E2F733419C72600008985F7;
};
};
};
buildConfigurationList = 6E2F733019C72600008985F7 /* Build configuration list for PBXProject "RCPageControlExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 6E2F732C19C72600008985F7;
productRefGroup = 6E2F733619C72600008985F7 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
6E2F733419C72600008985F7 /* RCPageControlExample */,
6E2F734D19C72601008985F7 /* RCPageControlExampleTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
6E2F733319C72600008985F7 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6E2F734419C72600008985F7 /* Main.storyboard in Resources */,
6E2F734919C72601008985F7 /* LaunchScreen.xib in Resources */,
6E2F734619C72601008985F7 /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6E2F734C19C72601008985F7 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
4205A7A3089C4258B519BEEC /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n";
showEnvVarsInLog = 0;
};
98157623954F4D229D890630 /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
6E2F733119C72600008985F7 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6E2F734119C72600008985F7 /* ViewController.m in Sources */,
6E2F733E19C72600008985F7 /* AppDelegate.m in Sources */,
6E2F733B19C72600008985F7 /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6E2F734A19C72601008985F7 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6E2F735519C72601008985F7 /* RCPageControlExampleTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
6E2F735019C72601008985F7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 6E2F733419C72600008985F7 /* RCPageControlExample */;
targetProxy = 6E2F734F19C72601008985F7 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
6E2F734219C72600008985F7 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
6E2F734319C72600008985F7 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
6E2F734719C72601008985F7 /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
6E2F734819C72601008985F7 /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
6E2F735619C72601008985F7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
6E2F735719C72601008985F7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
6E2F735919C72601008985F7 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 8E717ED8CE5548A48B510212 /* Pods.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = RCPageControlExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
6E2F735A19C72601008985F7 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 8E717ED8CE5548A48B510212 /* Pods.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = RCPageControlExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
6E2F735C19C72601008985F7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = RCPageControlExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RCPageControlExample.app/RCPageControlExample";
};
name = Debug;
};
6E2F735D19C72601008985F7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
INFOPLIST_FILE = RCPageControlExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RCPageControlExample.app/RCPageControlExample";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6E2F733019C72600008985F7 /* Build configuration list for PBXProject "RCPageControlExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6E2F735619C72601008985F7 /* Debug */,
6E2F735719C72601008985F7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6E2F735819C72601008985F7 /* Build configuration list for PBXNativeTarget "RCPageControlExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6E2F735919C72601008985F7 /* Debug */,
6E2F735A19C72601008985F7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6E2F735B19C72601008985F7 /* Build configuration list for PBXNativeTarget "RCPageControlExampleTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6E2F735C19C72601008985F7 /* Debug */,
6E2F735D19C72601008985F7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 6E2F732D19C72600008985F7 /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:RCPageControlExample.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,17 @@
//
// AppDelegate.h
// RCPageControlExample
//
// Created by Looping on 14/9/15.
// Copyright (c) 2014年 RidgeCorn. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

View File

@ -0,0 +1,45 @@
//
// AppDelegate.m
// RCPageControlExample
//
// Created by Looping on 14/9/15.
// Copyright (c) 2014 RidgeCorn. All rights reserved.
//
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// 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.
// 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.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// 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.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// 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.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6245" systemVersion="14A343f" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2014 RidgeCorn. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RCPageControl Example" textAlignment="center" lineBreakMode="middleTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="Cyr-Tp-OgX"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="8ie-xW-0ye" secondAttribute="leading" id="IRR-lm-10m"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="trailing" secondItem="8ie-xW-0ye" secondAttribute="trailing" id="KGF-Xw-9yR"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="140" id="PTD-Of-H4F"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="14A361c" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,38 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.ridgecorn.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@ -0,0 +1,15 @@
//
// ViewController.h
// RCPageControlExample
//
// Created by Looping on 14/9/15.
// Copyright (c) 2014年 RidgeCorn. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end

View File

@ -0,0 +1,102 @@
//
// ViewController.m
// RCPageControlExample
//
// Created by Looping on 14/9/15.
// Copyright (c) 2014 RidgeCorn. All rights reserved.
//
#import "ViewController.h"
#import <RCPageControl.h>
#import <iCarousel.h>
@interface ViewController () <iCarouselDataSource, iCarouselDelegate>
@property (nonatomic) RCPageControl *pageControlRC;
@property (nonatomic) iCarousel *pageViews;
@property (nonatomic) NSInteger numberOfPages;
@property (nonatomic) UIPageControl *pageControlUI;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self.view setBackgroundColor:[UIColor lightGrayColor]];
_numberOfPages = 6;
[self.view addSubview:({
if ( !_pageViews) {
_pageViews = [[iCarousel alloc] initWithFrame:self.view.frame];
_pageViews.dataSource = self;
[_pageViews setPagingEnabled:YES];
_pageViews.delegate = self;
}
_pageViews;
})];
[self.view addSubview:({
if ( !_pageControlRC) {
_pageControlRC = [[RCPageControl alloc] initWithNumberOfPages:_numberOfPages];
[_pageControlRC setCenter:({
CGPoint center = self.view.center;
center.y = self.view.frame.size.height - 200.f;
center;
})];
__weak ViewController *weakSelf = self;
[_pageControlRC setCurrentPageChanged:^(RCPageControl *pageControl) {
[weakSelf.pageViews scrollToItemAtIndex:pageControl.currentPage animated:YES];
}];
}
_pageControlRC;
})];
[self.view addSubview:({
if ( !_pageControlUI) {
_pageControlUI = [[UIPageControl alloc] init];
[_pageControlUI setNumberOfPages:_numberOfPages];
[_pageControlUI setCenter:({
CGPoint center = self.view.center;
center.y = 220.f;
center;
})];
[_pageControlUI addTarget:self action:@selector(changePage:) forControlEvents:UIControlEventValueChanged];
}
_pageControlUI;
})];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (NSInteger)numberOfItemsInCarousel:(iCarousel *)carousel {
return _numberOfPages;
}
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSInteger)index reusingView:(UIView *)view {
UIView *theNewView = view ?: [[UIView alloc] initWithFrame:self.view.frame];
[theNewView setBackgroundColor:index % 3 ? index % 2 ? [[UIColor purpleColor] colorWithAlphaComponent:0.5] : [[UIColor blueColor] colorWithAlphaComponent:0.5] : [[UIColor cyanColor] colorWithAlphaComponent:0.5]];
return theNewView;
}
- (void)carouselDidEndScrollingAnimation:(iCarousel *)carousel {
[_pageControlRC setCurrentPage:carousel.currentItemIndex];
[_pageControlUI setCurrentPage:carousel.currentItemIndex];
}
- (void)changePage:(id)sender {
[_pageViews scrollToItemAtIndex:_pageControlUI.currentPage animated:YES];
}
@end

View File

@ -0,0 +1,16 @@
//
// main.m
// RCPageControlExample
//
// Created by Looping on 14/9/15.
// Copyright (c) 2014 RidgeCorn. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.ridgecorn.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,40 @@
//
// RCPageControlExampleTests.m
// RCPageControlExampleTests
//
// Created by Looping on 14/9/15.
// Copyright (c) 2014 RidgeCorn. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
@interface RCPageControlExampleTests : XCTestCase
@end
@implementation RCPageControlExampleTests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end