-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d7ac55f
Showing
32 changed files
with
2,402 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
KIPageView.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+20.4 KB
...proj/project.xcworkspace/xcuserdata/SmartWalle.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
...deproj/project.xcworkspace/xcuserdata/SmartWalle.xcuserdatad/WorkspaceSettings.xcsettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?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>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key> | ||
<true/> | ||
<key>SnapshotAutomaticallyBeforeSignificantChanges</key> | ||
<true/> | ||
</dict> | ||
</plist> |
5 changes: 5 additions & 0 deletions
5
KIPageView.xcodeproj/xcuserdata/SmartWalle.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
type = "1" | ||
version = "2.0"> | ||
</Bucket> |
112 changes: 112 additions & 0 deletions
112
KIPageView.xcodeproj/xcuserdata/SmartWalle.xcuserdatad/xcschemes/KIPageView.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "0640" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "D5C4B2141B84B4B100A8792B" | ||
BuildableName = "KIPageView.app" | ||
BlueprintName = "KIPageView" | ||
ReferencedContainer = "container:KIPageView.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "NO" | ||
buildForArchiving = "NO" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "D5C4B22D1B84B4B100A8792B" | ||
BuildableName = "KIPageViewTests.xctest" | ||
BlueprintName = "KIPageViewTests" | ||
ReferencedContainer = "container:KIPageView.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
buildConfiguration = "Debug"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "D5C4B22D1B84B4B100A8792B" | ||
BuildableName = "KIPageViewTests.xctest" | ||
BlueprintName = "KIPageViewTests" | ||
ReferencedContainer = "container:KIPageView.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "D5C4B2141B84B4B100A8792B" | ||
BuildableName = "KIPageView.app" | ||
BlueprintName = "KIPageView" | ||
ReferencedContainer = "container:KIPageView.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</TestAction> | ||
<LaunchAction | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
buildConfiguration = "Debug" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "D5C4B2141B84B4B100A8792B" | ||
BuildableName = "KIPageView.app" | ||
BlueprintName = "KIPageView" | ||
ReferencedContainer = "container:KIPageView.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
buildConfiguration = "Release" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "D5C4B2141B84B4B100A8792B" | ||
BuildableName = "KIPageView.app" | ||
BlueprintName = "KIPageView" | ||
ReferencedContainer = "container:KIPageView.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
27 changes: 27 additions & 0 deletions
27
KIPageView.xcodeproj/xcuserdata/SmartWalle.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?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>SchemeUserState</key> | ||
<dict> | ||
<key>KIPageView.xcscheme</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
</dict> | ||
<key>SuppressBuildableAutocreation</key> | ||
<dict> | ||
<key>D5C4B2141B84B4B100A8792B</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
<key>D5C4B22D1B84B4B100A8792B</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// AppDelegate.h | ||
// KIPageView | ||
// | ||
// Created by SmartWalle on 15/8/19. | ||
// Copyright (c) 2015年 SmartWalle. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "RootViewController.h" | ||
|
||
@interface AppDelegate : UIResponder <UIApplicationDelegate> | ||
|
||
@property (nonatomic, strong) UIWindow *window; | ||
@property (nonatomic, strong) RootViewController *rootViewController; | ||
|
||
|
||
@end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// AppDelegate.m | ||
// KIPageView | ||
// | ||
// Created by SmartWalle on 15/8/19. | ||
// Copyright (c) 2015年 SmartWalle. All rights reserved. | ||
// | ||
|
||
#import "AppDelegate.h" | ||
|
||
@interface AppDelegate () | ||
|
||
@end | ||
|
||
@implementation AppDelegate | ||
|
||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | ||
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.rootViewController]; | ||
[self.window setRootViewController:navController]; | ||
[self.window makeKeyAndVisible]; | ||
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:. | ||
} | ||
|
||
#pragma mark - Getters and setters | ||
- (UIWindow *)window { | ||
if (_window == nil) { | ||
CGRect bounds = [UIScreen mainScreen].bounds; | ||
_window = [[UIWindow alloc] initWithFrame:bounds]; | ||
[_window setBackgroundColor:[UIColor whiteColor]]; | ||
} | ||
return _window; | ||
} | ||
|
||
- (RootViewController *)rootViewController { | ||
if (_rootViewController == nil) { | ||
_rootViewController = [[RootViewController alloc] initWithStyle:UITableViewStylePlain]; | ||
} | ||
return _rootViewController; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// BaseViewController.h | ||
// KIPageView | ||
// | ||
// Created by SmartWalle on 15/8/19. | ||
// Copyright (c) 2015年 SmartWalle. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "KIPageView.h" | ||
|
||
@interface BaseViewController : UIViewController <KIPageViewDelegate> { | ||
KIPageView *_pageView; | ||
} | ||
|
||
@property (nonatomic, strong) KIPageView *pageView; | ||
@property (nonatomic, strong) NSMutableArray *dataSource; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// | ||
// BaseViewController.m | ||
// KIPageView | ||
// | ||
// Created by SmartWalle on 15/8/19. | ||
// Copyright (c) 2015年 SmartWalle. All rights reserved. | ||
// | ||
|
||
#import "BaseViewController.h" | ||
|
||
@interface BaseViewController () | ||
|
||
@end | ||
|
||
@implementation BaseViewController | ||
|
||
- (void)loadView { | ||
[super loadView]; | ||
[self.view setBackgroundColor:[UIColor whiteColor]]; | ||
} | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
|
||
[self setEdgesForExtendedLayout:UIRectEdgeNone]; | ||
|
||
[self.view addSubview:self.pageView]; | ||
|
||
[self layoutSubviews]; | ||
} | ||
|
||
#pragma mark - Methods | ||
- (void)layoutSubviews { | ||
|
||
[self.pageView setTranslatesAutoresizingMaskIntoConstraints:NO]; | ||
|
||
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { | ||
[self.pageView setLayoutMargins:UIEdgeInsetsZero]; | ||
} | ||
|
||
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.pageView | ||
attribute:NSLayoutAttributeTop | ||
relatedBy:NSLayoutRelationEqual | ||
toItem:self.view | ||
attribute:NSLayoutAttributeTop | ||
multiplier:1.0 | ||
constant:10]]; | ||
|
||
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.pageView | ||
attribute:NSLayoutAttributeLeftMargin | ||
relatedBy:NSLayoutRelationEqual | ||
toItem:self.view | ||
attribute:NSLayoutAttributeLeft | ||
multiplier:1.0 | ||
constant:10]]; | ||
|
||
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.pageView | ||
attribute:NSLayoutAttributeRightMargin | ||
relatedBy:NSLayoutRelationEqual | ||
toItem:self.view | ||
attribute:NSLayoutAttributeRight | ||
multiplier:1.0 | ||
constant:-10]]; | ||
|
||
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.pageView | ||
attribute:NSLayoutAttributeBottomMargin | ||
relatedBy:NSLayoutRelationEqual | ||
toItem:self.view | ||
attribute:NSLayoutAttributeBottom | ||
multiplier:1.0 | ||
constant:-10]]; | ||
} | ||
|
||
#pragma mark - Getters and setters | ||
- (KIPageView *)pageView { | ||
if (_pageView == nil) { | ||
_pageView = [[KIPageView alloc] init]; | ||
[_pageView setBackgroundColor:[UIColor whiteColor]]; | ||
[_pageView setDelegate:self]; | ||
[_pageView setItemMargin:10]; | ||
} | ||
return _pageView; | ||
} | ||
|
||
- (NSMutableArray *)dataSource { | ||
if (_dataSource == nil) { | ||
_dataSource = [[NSMutableArray alloc] init]; | ||
for (int i=0; i<20; i++) { | ||
[_dataSource addObject:[NSString stringWithFormat:@"这是第 %d 页", i]]; | ||
} | ||
} | ||
return _dataSource; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// HorizontalListViewController.h | ||
// KIPageView | ||
// | ||
// Created by SmartWalle on 15/8/19. | ||
// Copyright (c) 2015年 SmartWalle. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "BaseViewController.h" | ||
|
||
@interface HorizontalListViewController : BaseViewController | ||
|
||
@end |
Oops, something went wrong.