├── CCButtton
├── .DS_Store
├── CCButtton.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ ├── baidaojuhe.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ ├── cyd.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ └── wsk.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ ├── baidaojuhe.xcuserdatad
│ │ └── xcschemes
│ │ │ ├── CCButtton.xcscheme
│ │ │ └── xcschememanagement.plist
│ │ ├── cyd.xcuserdatad
│ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ │ └── wsk.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── CCButtton.xcscheme
│ │ └── xcschememanagement.plist
├── CCButtton
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── IMG_0779.png
│ │ │ ├── Icon-120.png
│ │ │ ├── Icon-121.png
│ │ │ ├── Icon-180.png
│ │ │ ├── Icon-40.png
│ │ │ ├── Icon-58.png
│ │ │ ├── Icon-60.png
│ │ │ ├── Icon-80.png
│ │ │ └── Icon-87.png
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── CCButton.h
│ ├── CCButton.m
│ ├── CCButtton.xcdatamodeld
│ │ ├── .xccurrentversion
│ │ └── CCButtton.xcdatamodel
│ │ │ └── contents
│ ├── Info.plist
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── CCButttonTests
│ ├── CCButttonTests.m
│ └── Info.plist
└── CCButttonUITests
│ ├── CCButttonUITests.m
│ └── Info.plist
├── CCCalendar
├── .DS_Store
├── CCCalendar.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ ├── baidaojuhe.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ ├── cyd.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ └── wsk.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ ├── baidaojuhe.xcuserdatad
│ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ │ ├── CCCalendar.xcscheme
│ │ │ └── xcschememanagement.plist
│ │ ├── cyd.xcuserdatad
│ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ │ └── wsk.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── CCCalendar.xcscheme
│ │ └── xcschememanagement.plist
└── CCCalendar
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── IMG_0780.png
│ │ ├── Icon-120.png
│ │ ├── Icon-121.png
│ │ ├── Icon-180.png
│ │ ├── Icon-40.png
│ │ ├── Icon-58.png
│ │ ├── Icon-60.png
│ │ ├── Icon-80.png
│ │ └── Icon-87.png
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── CCCalendar.pch
│ ├── CCCalendar.xcdatamodeld
│ ├── .xccurrentversion
│ └── CCCalendar.xcdatamodel
│ │ └── contents
│ ├── CCCalendarView.h
│ ├── CCCalendarView.m
│ ├── CCChineseCalendar.h
│ ├── CCChineseCalendar.m
│ ├── CCCollectionHeaderView.h
│ ├── CCCollectionHeaderView.m
│ ├── CCCollectionViewCell.h
│ ├── CCCollectionViewCell.m
│ ├── CCDateManager.h
│ ├── CCDateManager.m
│ ├── CCMonthDataClient.h
│ ├── CCMonthDataClient.m
│ ├── Info.plist
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── CCImagePicker
├── .DS_Store
├── CCImagePicker.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ ├── baidaojuhe.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ ├── cyd.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ └── wsk.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ ├── baidaojuhe.xcuserdatad
│ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ │ ├── CCImagePicker.xcscheme
│ │ │ └── xcschememanagement.plist
│ │ ├── cyd.xcuserdatad
│ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ │ └── wsk.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── CCImagePicker.xcscheme
│ │ └── xcschememanagement.plist
├── CCImagePicker
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── IMG_0781.png
│ │ │ ├── Icon-120.png
│ │ │ ├── Icon-121.png
│ │ │ ├── Icon-180.png
│ │ │ ├── Icon-40.png
│ │ │ ├── Icon-58.png
│ │ │ ├── Icon-60.png
│ │ │ ├── Icon-80.png
│ │ │ └── Icon-87.png
│ │ ├── Contents.json
│ │ ├── ico_未选中.imageset
│ │ │ ├── Contents.json
│ │ │ └── ico_未选中@2x.png
│ │ └── ico_选中.imageset
│ │ │ ├── Contents.json
│ │ │ └── ico_选中@2x.png
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── CCAlbumCollectionViewCell.h
│ ├── CCAlbumCollectionViewCell.m
│ ├── CCAlbumViewController.h
│ ├── CCAlbumViewController.m
│ ├── CCAssetManager.h
│ ├── CCAssetManager.m
│ ├── CCImageDetailViewController.h
│ ├── CCImageDetailViewController.m
│ ├── CCImagePicker.xcdatamodeld
│ │ ├── .xccurrentversion
│ │ └── CCImagePicker.xcdatamodel
│ │ │ └── contents
│ ├── CCImagePickerViewController.h
│ ├── CCImagePickerViewController.m
│ ├── CCPageViewController.h
│ ├── CCPageViewController.m
│ ├── Info.plist
│ └── main.m
├── CCImagePickerTests
│ ├── CCImagePickerTests.m
│ └── Info.plist
└── CCImagePickerUITests
│ ├── CCImagePickerUITests.m
│ └── Info.plist
├── CCInteractiveTransitionAnimation
├── .DS_Store
├── CCInteractiveTransitionAnimation.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ ├── baidaojuhe.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ ├── cyd.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ └── wsk.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ ├── baidaojuhe.xcuserdatad
│ │ └── xcschemes
│ │ │ ├── CCInteractiveTransitionAnimation.xcscheme
│ │ │ └── xcschememanagement.plist
│ │ ├── cyd.xcuserdatad
│ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ │ └── wsk.xcuserdatad
│ │ └── xcschemes
│ │ ├── CCInteractiveTransitionAnimation.xcscheme
│ │ └── xcschememanagement.plist
├── CCInteractiveTransitionAnimation
│ ├── AnimationController.h
│ ├── AnimationController.m
│ ├── AnimationMacro.h
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── IMG_0784.png
│ │ │ ├── Icon-120.png
│ │ │ ├── Icon-121.png
│ │ │ ├── Icon-180.png
│ │ │ ├── Icon-40.png
│ │ │ ├── Icon-58.png
│ │ │ ├── Icon-60.png
│ │ │ ├── Icon-80.png
│ │ │ └── Icon-87.png
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── BaseNavigationController.h
│ ├── BaseNavigationController.m
│ ├── CCInteractiveTransitionAnimation.xcdatamodeld
│ │ ├── .xccurrentversion
│ │ └── CCInteractiveTransitionAnimation.xcdatamodel
│ │ │ └── contents
│ ├── CoverAnimation.h
│ ├── CoverAnimation.m
│ ├── Info.plist
│ ├── ScaleAnimation.h
│ ├── ScaleAnimation.m
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── CCInteractiveTransitionAnimationTests
│ ├── CCInteractiveTransitionAnimationTests.m
│ └── Info.plist
└── CCInteractiveTransitionAnimationUITests
│ ├── CCInteractiveTransitionAnimationUITests.m
│ └── Info.plist
├── CCPageViewController
├── .DS_Store
├── CCPageViewController.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ └── cyd.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── cyd.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── CCPageViewController
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── icon-1024.png
│ │ ├── icon-20@2x.png
│ │ ├── icon-20@3x.png
│ │ ├── icon-29@2x.png
│ │ ├── icon-29@3x.png
│ │ ├── icon-40@2x.png
│ │ ├── icon-40@3x.png
│ │ ├── icon-60@2x.png
│ │ └── icon-60@3x.png
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── DetailViewController.swift
│ ├── Info.plist
│ ├── PageVC
│ └── CCPageViewController.swift
│ └── ViewController.swift
├── CCSildeTabBarController
├── .DS_Store
├── CCSildeTabBarController.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ ├── baidaojuhe.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ ├── cyd.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ │ └── wsk.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ ├── baidaojuhe.xcuserdatad
│ │ └── xcschemes
│ │ │ ├── CCSildeTabBarController.xcscheme
│ │ │ └── xcschememanagement.plist
│ │ ├── cyd.xcuserdatad
│ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ │ └── wsk.xcuserdatad
│ │ └── xcschemes
│ │ ├── CCSildeTabBarController.xcscheme
│ │ └── xcschememanagement.plist
├── CCSildeTabBarController
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── IMG_0783.png
│ │ │ ├── Icon-120.png
│ │ │ ├── Icon-121.png
│ │ │ ├── Icon-180.png
│ │ │ ├── Icon-40.png
│ │ │ ├── Icon-58.png
│ │ │ ├── Icon-60.png
│ │ │ ├── Icon-80.png
│ │ │ └── Icon-87.png
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── BaseViewController.h
│ ├── BaseViewController.m
│ ├── CCSildeTabBarController.xcdatamodeld
│ │ ├── .xccurrentversion
│ │ └── CCSildeTabBarController.xcdatamodel
│ │ │ └── contents
│ ├── DetailViewController.h
│ ├── DetailViewController.m
│ ├── Info.plist
│ ├── MainTabBarViewController.h
│ ├── MainTabBarViewController.m
│ ├── NavigationViewController.h
│ ├── NavigationViewController.m
│ ├── TransitionAnimation.h
│ ├── TransitionAnimation.m
│ ├── TransitionController.h
│ ├── TransitionController.m
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── CCSildeTabBarControllerTests
│ ├── CCSildeTabBarControllerTests.m
│ └── Info.plist
└── CCSildeTabBarControllerUITests
│ ├── CCSildeTabBarControllerUITests.m
│ └── Info.plist
└── README.md
/CCButtton/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/.DS_Store
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcschemes/CCButtton.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCButtton.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7C5329E41D8E28D000D93596
16 |
17 | primary
18 |
19 |
20 | 7C532A001D8E28D000D93596
21 |
22 | primary
23 |
24 |
25 | 7C532A0B1D8E28D000D93596
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/xcuserdata/cyd.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCButtton.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | CCButtton.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 0
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/xcuserdata/wsk.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/xcuserdata/wsk.xcuserdatad/xcschemes/CCButtton.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton.xcodeproj/xcuserdata/wsk.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCButtton.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7C5329E41D8E28D000D93596
16 |
17 | primary
18 |
19 |
20 | 7C532A001D8E28D000D93596
21 |
22 | primary
23 |
24 |
25 | 7C532A0B1D8E28D000D93596
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // CCButtton
4 | //
5 | // Created by wsk on 16/9/18.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 |
16 | @property (readonly, strong) NSPersistentContainer *persistentContainer;
17 |
18 | - (void)saveContext;
19 |
20 | @end
21 |
22 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // CCButtton
4 | //
5 | // Created by wsk on 16/9/18.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 |
24 | - (void)applicationWillResignActive:(UIApplication *)application {
25 | // 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.
26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
27 | }
28 |
29 |
30 | - (void)applicationDidEnterBackground:(UIApplication *)application {
31 | // 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.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 |
36 | - (void)applicationWillEnterForeground:(UIApplication *)application {
37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
38 | }
39 |
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // 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.
43 | }
44 |
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | // Saves changes in the application's managed object context before the application terminates.
49 | [self saveContext];
50 | }
51 |
52 |
53 | #pragma mark - Core Data stack
54 |
55 | @synthesize persistentContainer = _persistentContainer;
56 |
57 | - (NSPersistentContainer *)persistentContainer {
58 | // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it.
59 | @synchronized (self) {
60 | if (_persistentContainer == nil) {
61 | _persistentContainer = [[NSPersistentContainer alloc] initWithName:@"CCButtton"];
62 | [_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) {
63 | if (error != nil) {
64 | // Replace this implementation with code to handle the error appropriately.
65 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
66 |
67 | /*
68 | Typical reasons for an error here include:
69 | * The parent directory does not exist, cannot be created, or disallows writing.
70 | * The persistent store is not accessible, due to permissions or data protection when the device is locked.
71 | * The device is out of space.
72 | * The store could not be migrated to the current model version.
73 | Check the error message to determine what the actual problem was.
74 | */
75 | NSLog(@"Unresolved error %@, %@", error, error.userInfo);
76 | abort();
77 | }
78 | }];
79 | }
80 | }
81 |
82 | return _persistentContainer;
83 | }
84 |
85 | #pragma mark - Core Data Saving support
86 |
87 | - (void)saveContext {
88 | NSManagedObjectContext *context = self.persistentContainer.viewContext;
89 | NSError *error = nil;
90 | if ([context hasChanges] && ![context save:&error]) {
91 | // Replace this implementation with code to handle the error appropriately.
92 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
93 | NSLog(@"Unresolved error %@, %@", error, error.userInfo);
94 | abort();
95 | }
96 | }
97 |
98 | @end
99 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-58.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-87.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-80.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-120.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-121.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-180.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "1024x1024",
53 | "idiom" : "ios-marketing",
54 | "filename" : "IMG_0779.png",
55 | "scale" : "1x"
56 | }
57 | ],
58 | "info" : {
59 | "version" : 1,
60 | "author" : "xcode"
61 | }
62 | }
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/IMG_0779.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/IMG_0779.png
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-120.png
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-121.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-121.png
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-180.png
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-40.png
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-58.png
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-80.png
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCButtton/CCButtton/Assets.xcassets/AppIcon.appiconset/Icon-87.png
--------------------------------------------------------------------------------
/CCButtton/CCButtton/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 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/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 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/CCButton.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCButton.h
3 | // CCButtton
4 | //
5 | // Created by wsk on 16/9/18.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCButton : UIButton
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/CCButton.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCButton.m
3 | // CCButtton
4 | //
5 | // Created by wsk on 16/9/18.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCButton.h"
10 |
11 | @implementation CCButton
12 |
13 | +(instancetype)buttonWithType:(UIButtonType)buttonType{
14 | CCButton *ccButton = [super buttonWithType:buttonType];
15 | if (ccButton) {
16 | ccButton.titleLabel.backgroundColor = [UIColor blueColor];
17 | ccButton.titleLabel.textAlignment = NSTextAlignmentCenter;
18 | ccButton.imageView.layer.masksToBounds = YES;
19 | }
20 | return ccButton;
21 | }
22 |
23 | // 返回背景边界(background)
24 | - (CGRect)backgroundRectForBounds:(CGRect)bounds{
25 | NSLog(@"背景边界:%@",NSStringFromCGRect(bounds));
26 | return bounds;
27 | }
28 |
29 | // 返回内容边界 标题、图片、标题与图片之间的间隔(title + image + the image and title separately)
30 | - (CGRect)contentRectForBounds:(CGRect)bounds{
31 | NSLog(@"内容边界:%@",NSStringFromCGRect(bounds));
32 | return bounds;
33 | }
34 |
35 | // 返回标题边界
36 | - (CGRect)titleRectForContentRect:(CGRect)contentRect{
37 | NSLog(@"标题边界:%@",NSStringFromCGRect(contentRect));
38 | return CGRectMake(0, contentRect.size.height-30, contentRect.size.width, 30);
39 | }
40 |
41 | // 返回图片边界
42 | - (CGRect)imageRectForContentRect:(CGRect)contentRect{
43 | NSLog(@"图片边界:%@",NSStringFromCGRect(contentRect));
44 | CGFloat imageWidth = MIN(contentRect.size.height - 30, contentRect.size.width);
45 | return CGRectMake(contentRect.size.width/2 - imageWidth/2, 0, imageWidth, imageWidth);
46 | }
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/CCButtton.xcdatamodeld/.xccurrentversion:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | _XCCurrentVersionName
6 | CCButtton.xcdatamodel
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/CCButtton.xcdatamodeld/CCButtton.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // CCButtton
4 | //
5 | // Created by wsk on 16/9/18.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // CCButtton
4 | //
5 | // Created by wsk on 16/9/18.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "CCButton.h"
11 |
12 | static UIImage* createImageWithColor(UIColor* color)
13 | {
14 | CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
15 | UIGraphicsBeginImageContext(rect.size);
16 | CGContextRef context = UIGraphicsGetCurrentContext();
17 | CGContextSetFillColorWithColor(context, [color CGColor]);
18 | CGContextFillRect(context, rect);
19 | UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
20 | UIGraphicsEndImageContext();
21 | return theImage;
22 | }
23 |
24 | @interface ViewController ()
25 |
26 | @end
27 |
28 | @implementation ViewController
29 |
30 | - (void)viewDidLoad {
31 | [super viewDidLoad];
32 | CCButton *button = [CCButton buttonWithType:UIButtonTypeCustom];
33 | button.frame = CGRectMake(100, 100, 80, 110);
34 | button.layer.masksToBounds = YES;
35 | button.layer.cornerRadius = 5;
36 | button.layer.borderWidth = 1;
37 | button.layer.borderColor = [UIColor redColor].CGColor;
38 | [button setTitle:@"上图下文" forState:UIControlStateNormal];
39 | [button setImage:createImageWithColor([UIColor cyanColor]) forState:UIControlStateNormal];
40 | [self.view addSubview:button];
41 | }
42 |
43 | - (void)didReceiveMemoryWarning {
44 | [super didReceiveMemoryWarning];
45 | // Dispose of any resources that can be recreated.
46 | }
47 |
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/CCButtton/CCButtton/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // CCButtton
4 | //
5 | // Created by wsk on 16/9/18.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CCButtton/CCButttonTests/CCButttonTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCButttonTests.m
3 | // CCButttonTests
4 | //
5 | // Created by wsk on 16/9/18.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCButttonTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CCButttonTests
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 |
--------------------------------------------------------------------------------
/CCButtton/CCButttonTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CCButtton/CCButttonUITests/CCButttonUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCButttonUITests.m
3 | // CCButttonUITests
4 | //
5 | // Created by wsk on 16/9/18.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCButttonUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CCButttonUITests
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 |
--------------------------------------------------------------------------------
/CCButtton/CCButttonUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CCCalendar/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/.DS_Store
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcschemes/CCCalendar.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCCalendar.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7CBF9EA51DD94C0000C939A4
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/xcuserdata/cyd.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCCalendar.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | CCCalendar.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 0
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/xcuserdata/wsk.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/xcuserdata/wsk.xcuserdatad/xcschemes/CCCalendar.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
69 |
70 |
71 |
77 |
79 |
85 |
86 |
87 |
88 |
90 |
91 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar.xcodeproj/xcuserdata/wsk.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCCalendar.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7CBF9EA51DD94C0000C939A4
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 |
16 | @property (readonly, strong) NSPersistentContainer *persistentContainer;
17 |
18 | - (void)saveContext;
19 |
20 | @end
21 |
22 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-58.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-87.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-80.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-120.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-121.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-180.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "1024x1024",
53 | "idiom" : "ios-marketing",
54 | "filename" : "IMG_0780.png",
55 | "scale" : "1x"
56 | }
57 | ],
58 | "info" : {
59 | "version" : 1,
60 | "author" : "xcode"
61 | }
62 | }
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/IMG_0780.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/IMG_0780.png
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-120.png
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-121.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-121.png
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-180.png
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-40.png
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-58.png
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-80.png
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCCalendar/CCCalendar/Assets.xcassets/AppIcon.appiconset/Icon-87.png
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/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 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/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 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCCalendar.pch:
--------------------------------------------------------------------------------
1 | //
2 | // CCCalender.pch
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #ifndef CCCalender_pch
10 | #define CCCalender_pch
11 |
12 | #ifdef DEBUG
13 | #define NSLog(FORMAT, ...) printf("function: %s [Line: %d]: %s\n", __PRETTY_FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
14 | #else
15 | #define NSLog(...)
16 | #endif
17 |
18 | #endif /* CCCalender_pch */
19 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCCalendar.xcdatamodeld/.xccurrentversion:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | _XCCurrentVersionName
6 | CCCalendar.xcdatamodel
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCCalendar.xcdatamodeld/CCCalendar.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCCalendarView.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCCalendarView.h
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CCChineseCalendar.h"
11 |
12 | @protocol CCCalendarViewDelegate
13 |
14 | // 当前界面显示的第一个Cell所属的年份
15 | -(void)calendarDidScrollToYear:(NSUInteger )year lunarYear:(NSString *)lunarYear;
16 |
17 | @end
18 |
19 | @interface CCCalendarView : UIView
20 |
21 | @property(nonatomic, readonly)NSArray *selectedDates;
22 | @property(nonatomic, readonly)NSArray *selectedLunarDates;
23 |
24 | @property(nonatomic, weak)id delegate;
25 | @property(nonatomic, assign)BOOL allowsMultipleSelection;// 是否允许多选
26 |
27 | +(instancetype)new NS_UNAVAILABLE;
28 |
29 | -(instancetype)init NS_UNAVAILABLE;
30 |
31 | -(instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCChineseCalendar.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCChineseCalendar.h
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCChineseCalendarModel : NSObject
12 |
13 | @property(nonatomic, copy)NSString *year;
14 | @property(nonatomic, copy)NSString *month;
15 | @property(nonatomic, copy)NSString *day;
16 |
17 | @end
18 |
19 | @interface CCChineseCalendar : NSObject
20 |
21 | +(CCChineseCalendarModel *)getChineseCalenderWithDate:(NSDate *)date;
22 |
23 | @end
24 |
25 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCChineseCalendar.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCChineseCalendar.m
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCChineseCalendar.h"
10 |
11 | @implementation CCChineseCalendarModel
12 |
13 | -(NSString *)description{
14 | return [NSString stringWithFormat:@"year:%@, month:%@, day: %@",self.year,self.month,self.day];
15 | }
16 |
17 | @end
18 |
19 | @implementation CCChineseCalendar
20 |
21 | static NSArray *chineseYears;
22 | static NSArray *chineseMonths;
23 | static NSArray *chineseDays;
24 |
25 | +(CCChineseCalendarModel *)getChineseCalenderWithDate:(NSDate *)date{
26 | chineseYears =@[@"甲子", @"乙丑", @"丙寅", @"丁卯", @"戊辰", @"己巳", @"庚午", @"辛未", @"壬申", @"癸酉",
27 | @"甲戌", @"乙亥", @"丙子", @"丁丑", @"戊寅", @"己卯", @"庚辰", @"辛己", @"壬午", @"癸未",
28 | @"甲申", @"乙酉", @"丙戌", @"丁亥", @"戊子", @"己丑", @"庚寅", @"辛卯", @"壬辰", @"癸巳",
29 | @"甲午", @"乙未", @"丙申", @"丁酉", @"戊戌", @"己亥", @"庚子", @"辛丑", @"壬寅", @"癸丑",
30 | @"甲辰", @"乙巳", @"丙午", @"丁未", @"戊申", @"己酉", @"庚戌", @"辛亥", @"壬子", @"癸丑",
31 | @"甲寅", @"乙卯", @"丙辰", @"丁巳", @"戊午", @"己未", @"庚申", @"辛酉", @"壬戌", @"癸亥", ];
32 |
33 | chineseMonths=@[@"正月", @"二月", @"三月", @"四月", @"五月", @"六月",
34 | @"七月", @"八月", @"九月", @"十月", @"冬月", @"腊月"];
35 |
36 | chineseDays = @[@"初一", @"初二", @"初三", @"初四", @"初五", @"初六", @"初七", @"初八", @"初九", @"初十",
37 | @"十一", @"十二", @"十三", @"十四", @"十五", @"十六", @"十七", @"十八", @"十九", @"二十",
38 | @"廿一", @"廿二", @"廿三", @"廿四", @"廿五", @"廿六", @"廿七", @"廿八", @"廿九", @"三十"];
39 |
40 | NSCalendar *localeCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierChinese];
41 | unsigned unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay;
42 | NSDateComponents *localeComp = [localeCalendar components:unitFlags fromDate:date];
43 |
44 | CCChineseCalendarModel *model = [[CCChineseCalendarModel alloc]init];
45 | if (localeComp.year <= chineseYears.count && localeComp.month <= chineseMonths.count && localeComp.day <= chineseDays.count) {
46 | model.year = [chineseYears objectAtIndex:localeComp.year-1];
47 | model.month = [chineseMonths objectAtIndex:localeComp.month-1];
48 | model.day = [[chineseDays objectAtIndex:localeComp.day-1] isEqualToString:@"初一"]?[chineseMonths objectAtIndex:localeComp.month-1]:[chineseDays objectAtIndex:localeComp.day-1];
49 | }
50 |
51 | return model;
52 | }
53 |
54 | @end
55 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCCollectionHeaderView.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCCollectionHeaderView.h
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCCollectionHeaderView : UICollectionReusableView
12 |
13 | @property (nonatomic,strong) UILabel* titleLabel;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCCollectionHeaderView.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCCollectionHeaderView.m
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCCollectionHeaderView.h"
10 |
11 | @implementation CCCollectionHeaderView
12 |
13 | - (id)initWithFrame:(CGRect)frame{
14 | self = [super initWithFrame:frame];
15 | if(self){
16 | self.backgroundColor = [UIColor whiteColor];
17 | _titleLabel = [[UILabel alloc]initWithFrame:self.bounds];
18 | _titleLabel.font = [UIFont systemFontOfSize:15];
19 | [self addSubview:_titleLabel];
20 | }
21 | return self;
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCCollectionViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCCollectionViewCell.h
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCCollectionViewCell : UICollectionViewCell
12 |
13 | @property (nonatomic,strong) UILabel* lunarLabel;
14 |
15 | @property (nonatomic,strong) UILabel* gregorianLabel;
16 |
17 | @property (nonatomic,strong) UIView * backView;
18 |
19 | -(void)setContent:(NSDateComponents *)dateComponents;
20 |
21 | -(void)setSelected:(BOOL)selected dateComponents:(NSDateComponents *)dateComponents;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCCollectionViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCCollectionViewCell.m
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCCollectionViewCell.h"
10 | #import "CCChineseCalendar.h"
11 |
12 | @interface CCCollectionViewCell()
13 |
14 | @property (nonatomic,strong) UIView* topLineView;
15 |
16 | @end
17 |
18 | @implementation CCCollectionViewCell
19 |
20 | - (id)initWithFrame:(CGRect)frame{
21 | self = [super initWithFrame:frame];
22 | if(self){
23 | self.backgroundColor = [UIColor clearColor];
24 |
25 | _backView = [[UIView alloc]initWithFrame:CGRectMake(2, 2, CGRectGetWidth(frame)-4, CGRectGetWidth(frame)-4)];
26 | _backView.layer.masksToBounds = YES;
27 | _backView.layer.cornerRadius = _backView.bounds.size.width/2;
28 | [self.contentView addSubview:_backView];
29 |
30 | _topLineView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(frame), 0.6)];
31 | _topLineView.backgroundColor = [UIColor lightGrayColor];
32 | [self.contentView addSubview:_topLineView];
33 |
34 | _gregorianLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, 5, CGRectGetWidth(frame)-5*2, 25)];
35 | _gregorianLabel.backgroundColor = [UIColor clearColor];
36 | _gregorianLabel.textAlignment = NSTextAlignmentCenter;
37 | _gregorianLabel.font = [UIFont systemFontOfSize:18];
38 | [self.contentView addSubview:_gregorianLabel];
39 |
40 | _lunarLabel = [[UILabel alloc]initWithFrame:CGRectMake(_gregorianLabel.frame.origin.x, CGRectGetMaxY(_gregorianLabel.frame), _gregorianLabel.bounds.size.width, 20)];
41 | _lunarLabel.backgroundColor = [UIColor clearColor];
42 | _lunarLabel.font = [UIFont systemFontOfSize:12];
43 | _lunarLabel.textAlignment = NSTextAlignmentCenter;
44 | [self.contentView addSubview:_lunarLabel];
45 | }
46 | return self;
47 | }
48 |
49 | -(void)setContent:(NSDateComponents *)dateComponents{
50 | NSCalendar *calendar = [NSCalendar currentCalendar];
51 | NSDate *date = [calendar dateFromComponents:dateComponents];
52 | self.lunarLabel.text = [CCChineseCalendar getChineseCalenderWithDate:date].day;
53 | self.gregorianLabel.text = [NSString stringWithFormat:@"%ld",dateComponents.day];
54 |
55 | BOOL isWeekend = [calendar isDateInWeekend:date];
56 | BOOL isToday = [calendar isDateInToday:date];
57 |
58 | if (isToday) {
59 | self.backView.backgroundColor = [UIColor redColor];
60 | self.lunarLabel.textColor = [UIColor whiteColor];
61 | self.gregorianLabel.textColor = [UIColor whiteColor];
62 | }
63 | else{
64 | if (isWeekend) {
65 | self.lunarLabel.textColor = [UIColor lightGrayColor];
66 | self.gregorianLabel.textColor = [UIColor lightGrayColor];
67 | }
68 | else{
69 | self.lunarLabel.textColor = [UIColor blackColor];
70 | self.gregorianLabel.textColor = [UIColor blackColor];
71 | }
72 | }
73 | }
74 |
75 | -(void)setSelected:(BOOL)selected dateComponents:(NSDateComponents *)dateComponents{
76 |
77 | NSCalendar *calendar = [NSCalendar currentCalendar];
78 | NSDate *date = [calendar dateFromComponents:dateComponents];
79 | BOOL isWeekend = [calendar isDateInWeekend:date];
80 | BOOL isToday = [calendar isDateInToday:date];
81 |
82 | if (selected) {
83 | self.lunarLabel.textColor = [UIColor whiteColor];
84 | self.gregorianLabel.textColor = [UIColor whiteColor];
85 | self.backView.backgroundColor = [UIColor blackColor];
86 | }
87 | else{
88 | if (isToday) {
89 | self.backView.backgroundColor = [UIColor redColor];
90 | self.lunarLabel.textColor = [UIColor whiteColor];
91 | self.gregorianLabel.textColor = [UIColor whiteColor];
92 | return ;
93 | }
94 |
95 | if (isWeekend) {
96 | self.lunarLabel.textColor = [UIColor lightGrayColor];
97 | self.gregorianLabel.textColor = [UIColor lightGrayColor];
98 | self.backView.backgroundColor = [UIColor clearColor];
99 | }
100 | else{
101 | self.lunarLabel.textColor = [UIColor blackColor];
102 | self.gregorianLabel.textColor = [UIColor blackColor];
103 | self.backView.backgroundColor = [UIColor clearColor];
104 | }
105 | }
106 | }
107 |
108 | @end
109 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCDateManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCDateManager.h
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCDateManager : NSObject
12 |
13 | /// 一个月有几天
14 | +(NSInteger )numberDaysOfMonth:(NSDate *)date;
15 |
16 | /// 一个月有几个周
17 | +(NSInteger )numberWeeksOfMonth:(NSDate *)date;
18 |
19 | /// 是否是今天
20 | +(BOOL )isToday:(NSDate *)date;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCDateManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCDateManager.m
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCDateManager.h"
10 |
11 | @implementation CCDateManager
12 |
13 | +(NSInteger )numberDaysOfMonth:(NSDate *)date{
14 | NSCalendar *calender = [NSCalendar currentCalendar];
15 | return [calender rangeOfUnit:NSCalendarUnitDay inUnit:NSCalendarUnitMonth forDate:date].length;
16 | }
17 |
18 | +(NSInteger )numberWeeksOfMonth:(NSDate *)date{
19 | NSCalendar *calender = [NSCalendar currentCalendar];
20 | return [calender rangeOfUnit:NSCalendarUnitWeekOfMonth inUnit:NSCalendarUnitMonth forDate:date].length;
21 | }
22 |
23 | +(BOOL)isToday:(NSDate *)date{
24 | NSCalendar *calendar = [NSCalendar currentCalendar];
25 | return [calendar isDateInToday:date];
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCMonthDataClient.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCMonthDataClient.h
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCMonthDataClient : NSObject
12 |
13 | /**
14 | * 请求某月之前的月份
15 | * date: 表示当前的月份
16 | * count: 需要请求的数量
17 | *
18 | * 例如:date:2016.11.14 count:3
19 | * return @['2016.10.14','2016.9.14','2016.8.14'];
20 | *
21 | */
22 | +(NSArray *)requestMonthBeforeDate:(NSDate *)date count:(NSInteger)count;
23 |
24 | /**
25 | * 请求某月之后的月份
26 | * date: 表示当前的月份
27 | * count: 需要请求的数量
28 | *
29 | * 例如:date:2016.11.14 count:3
30 | * return @['2016.12.14','2017.1.14','2017.2.14'];
31 | *
32 | */
33 | +(NSArray *)requestMonthAfterDate:(NSDate *)date count:(NSInteger)count;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/CCMonthDataClient.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCMonthDataClient.m
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCMonthDataClient.h"
10 |
11 | @implementation CCMonthDataClient
12 |
13 | +(NSArray *)requestMonthBeforeDate:(NSDate *)date count:(NSInteger)count{
14 | NSMutableArray *temp = [NSMutableArray array];
15 | NSCalendar *calender = [NSCalendar currentCalendar];
16 | for (int i = (int)count; i > 0; --i) {
17 | NSDateComponents *components = [[NSDateComponents alloc] init];
18 | [components setMonth:-i];
19 | NSDate *resultDate = [calender dateByAddingComponents:components toDate:date options:0];
20 | NSCalendarUnit unit = NSCalendarUnitYear |
21 | NSCalendarUnitDay |
22 | NSCalendarUnitMonth |
23 | NSCalendarUnitWeekday |
24 | NSCalendarUnitCalendar;
25 | NSDateComponents *dateComponent = [calender components:unit fromDate:resultDate];
26 | [temp addObject:dateComponent];
27 | }
28 | return temp;
29 | }
30 |
31 | +(NSArray *)requestMonthAfterDate:(NSDate *)date count:(NSInteger)count{
32 | NSMutableArray *temp = [NSMutableArray array];
33 | NSCalendar *calender = [NSCalendar currentCalendar];
34 | for (int i = 0; i < count; i++) {
35 | NSDateComponents *components = [[NSDateComponents alloc] init];
36 | [components setMonth:i+1];
37 | NSDate *resultDate = [calender dateByAddingComponents:components toDate:date options:0];
38 | NSCalendarUnit unit = NSCalendarUnitYear |
39 | NSCalendarUnitDay |
40 | NSCalendarUnitMonth |
41 | NSCalendarUnitWeekday |
42 | NSCalendarUnitCalendar;
43 | NSDateComponents *dateComponent = [calender components:unit fromDate:resultDate];
44 | [temp addObject:dateComponent];
45 | }
46 | return temp;
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/CCCalendar/CCCalendar/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // CCCalendar
4 | //
5 | // Created by wsk on 2016/11/14.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "CCCalendarView.h"
11 |
12 | @interface ViewController ()
13 |
14 | @property(nonatomic, strong)CCCalendarView *calendarView;
15 |
16 | @end
17 |
18 | @implementation ViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | self.view.backgroundColor = [UIColor whiteColor];
23 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(rightNaviBarButtonclick:)];
24 |
25 | self.calendarView = [[CCCalendarView alloc]initWithFrame:self.view.frame];
26 | self.calendarView.delegate = self;
27 | self.calendarView.allowsMultipleSelection = YES;
28 | [self.view addSubview:self.calendarView];
29 | }
30 |
31 | -(void)rightNaviBarButtonclick:(UIButton *)btn{
32 | NSMutableString *message = [NSMutableString stringWithFormat:@"公历:\n"];
33 | NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
34 | [formatter setDateFormat:@"YYYY-MM-dd"];
35 | for (int i = 0; i
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CCImagePicker/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/.DS_Store
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcschemes/CCImagePicker.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCImagePicker.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7CA6B6CB1D6AD26800AA7728
16 |
17 | primary
18 |
19 |
20 | 7CA6B6E71D6AD26800AA7728
21 |
22 | primary
23 |
24 |
25 | 7CA6B6F21D6AD26800AA7728
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/xcuserdata/cyd.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCImagePicker.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | CCImagePicker.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 0
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/xcuserdata/wsk.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/xcuserdata/wsk.xcuserdatad/xcschemes/CCImagePicker.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker.xcodeproj/xcuserdata/wsk.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCImagePicker.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7CA6B6CB1D6AD26800AA7728
16 |
17 | primary
18 |
19 |
20 | 7CA6B6E71D6AD26800AA7728
21 |
22 | primary
23 |
24 |
25 | 7CA6B6F21D6AD26800AA7728
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 |
16 | @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
17 | @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
18 | @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
19 |
20 | - (void)saveContext;
21 | - (NSURL *)applicationDocumentsDirectory;
22 |
23 |
24 | @end
25 |
26 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-58.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-87.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-80.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-120.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-121.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-180.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "1024x1024",
53 | "idiom" : "ios-marketing",
54 | "filename" : "IMG_0781.png",
55 | "scale" : "1x"
56 | }
57 | ],
58 | "info" : {
59 | "version" : 1,
60 | "author" : "xcode"
61 | }
62 | }
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/IMG_0781.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/IMG_0781.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-120.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-121.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-121.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-180.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-40.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-58.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-80.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/AppIcon.appiconset/Icon-87.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/ico_未选中.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "ico_未选中@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/ico_未选中.imageset/ico_未选中@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/ico_未选中.imageset/ico_未选中@2x.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/ico_选中.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "ico_选中@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Assets.xcassets/ico_选中.imageset/ico_选中@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCImagePicker/CCImagePicker/Assets.xcassets/ico_选中.imageset/ico_选中@2x.png
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/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 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/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 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCAlbumCollectionViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCAlbumCollectionViewCell.h
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class CDAlbumCollectionViewCell;
12 |
13 | @protocol CDAlbumCollectionViewCellDelegate
14 |
15 | -(void)selectButtonClick:(CDAlbumCollectionViewCell *)cell;
16 |
17 | @end
18 |
19 | @interface CDAlbumCollectionViewCell : UICollectionViewCell
20 |
21 | @property(nonatomic,weak)id delegate;
22 |
23 | @property(nonatomic,assign)BOOL select;
24 |
25 | @end
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCAlbumCollectionViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCAlbumCollectionViewCell.m
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCAlbumCollectionViewCell.h"
10 |
11 | @interface CDAlbumCollectionViewCell()
12 | {
13 | UIButton *_selectButton;
14 | }
15 | @end
16 |
17 | @implementation CDAlbumCollectionViewCell
18 |
19 | -(instancetype)initWithFrame:(CGRect)frame{
20 | self = [super initWithFrame:frame];
21 | if (self) {
22 | _selectButton = [UIButton buttonWithType:UIButtonTypeCustom];
23 | _selectButton.frame = CGRectMake(frame.size.width-20, frame.size.height-20, 20, 20);
24 | [_selectButton setImage:[UIImage imageNamed:@"ico_未选中"] forState:UIControlStateNormal];
25 | [_selectButton setImage:[UIImage imageNamed:@"ico_选中"] forState:UIControlStateSelected];
26 | [_selectButton addTarget:self action:@selector(selectAction:) forControlEvents:UIControlEventTouchUpInside];
27 | [self.contentView addSubview:_selectButton];
28 | }
29 | return self;
30 | }
31 |
32 | -(void)setSelect:(BOOL)select{
33 | _selectButton.selected = select;
34 | _select = select;
35 | }
36 |
37 | -(void)selectAction:(UIButton *)btn{
38 | if (_delegate && [_delegate respondsToSelector:@selector(selectButtonClick:)]) {
39 | [_delegate selectButtonClick:self];
40 | }
41 | }
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCAlbumViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCAlbumViewController.h
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @protocol CCAlbumViewControllerDelegate
13 |
14 | -(void)imagePickerViewControllerFinishClick:(NSArray *)imageArray;
15 |
16 | @end
17 |
18 |
19 | @interface CCAlbumViewController : UIViewController
20 |
21 | @property (nonatomic, weak)id delegate;
22 |
23 | @property (nonatomic, strong)ALAssetsGroup *assetsGroup;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCAssetManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCAssetManager.h
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface CCAssetManager : NSObject
13 |
14 | @property (nonatomic, strong) NSArray *photoAssets;
15 |
16 | + (CCAssetManager *)sharedInstance;
17 |
18 | - (NSUInteger)photoCount;
19 |
20 | - (UIImage *)photoAtIndex:(NSUInteger)index;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCAssetManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCAssetManager.m
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCAssetManager.h"
10 | #import
11 |
12 | @implementation CCAssetManager
13 |
14 | +(CCAssetManager *)sharedInstance{
15 | static dispatch_once_t onceToken;
16 | static CCAssetManager *shared;
17 | dispatch_once(&onceToken, ^{
18 | shared = [[CCAssetManager alloc] init];
19 | });
20 | return shared;
21 | }
22 |
23 | -(NSUInteger)photoCount{
24 | return self.photoAssets.count;
25 | }
26 |
27 | -(UIImage *)photoAtIndex:(NSUInteger)index{
28 | ALAsset *photoAsset = self.photoAssets[index];
29 | ALAssetRepresentation *assetRepresentation = [photoAsset defaultRepresentation];
30 | UIImage *fullScreenImage = [UIImage imageWithCGImage:[assetRepresentation fullScreenImage]
31 | scale:[assetRepresentation scale]
32 | orientation:UIImageOrientationUp];
33 | return fullScreenImage;
34 | }
35 |
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCImageDetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCImageDetailViewController.h
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCImageDetailViewController : UIViewController
12 |
13 | @property (nonatomic,assign)NSUInteger pageIndex;
14 |
15 | + (CCImageDetailViewController *)previewControllerForPageIndex:(NSUInteger)pageIndex;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCImageDetailViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCImageDetailViewController.m
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCImageDetailViewController.h"
10 | #import "CCAssetManager.h"
11 |
12 | @interface CCImageDetailViewController ()
13 |
14 | @property(nonatomic, strong)UIScrollView *scrollView;
15 | @property(nonatomic, strong)UIImageView *imgeView;
16 |
17 | @end
18 |
19 | @implementation CCImageDetailViewController
20 |
21 | - (instancetype)initWithPageIndex:(NSInteger)pageIndex{
22 | self = [super init];
23 | if (self != nil){
24 | _pageIndex = pageIndex;
25 | }
26 | return self;
27 | }
28 |
29 | + (CCImageDetailViewController *)previewControllerForPageIndex:(NSUInteger)pageIndex{
30 | if (pageIndex < [[CCAssetManager sharedInstance] photoCount]) {
31 | return [[self alloc] initWithPageIndex:pageIndex];
32 | }
33 | return nil;
34 | }
35 |
36 | -(void)loadView{
37 | self.view = self.scrollView;
38 | }
39 |
40 | -(void)viewDidLoad
41 | {
42 | [super viewDidLoad];
43 |
44 | _imgeView = [[UIImageView alloc]initWithFrame:self.view.bounds];
45 | _imgeView.contentMode = UIViewContentModeScaleAspectFit;
46 | _imgeView.image = [[CCAssetManager sharedInstance] photoAtIndex:_pageIndex];
47 | [self.view addSubview:_imgeView];
48 | }
49 |
50 | -(void)viewWillAppear:(BOOL)animated{
51 | [super viewWillAppear:animated];
52 | self.parentViewController.parentViewController.title = [NSString stringWithFormat:@"%@ / %@", [@(self.pageIndex+1) stringValue], [@([[CCAssetManager sharedInstance] photoCount]) stringValue]];
53 | }
54 |
55 | -(UIScrollView *)scrollView
56 | {
57 | if (_scrollView == nil) {
58 | _scrollView = [[UIScrollView alloc]initWithFrame:[UIScreen mainScreen].bounds];
59 | _scrollView.showsVerticalScrollIndicator = NO;
60 | _scrollView.showsHorizontalScrollIndicator = NO;
61 | _scrollView.bouncesZoom = YES;
62 | _scrollView.decelerationRate = UIScrollViewDecelerationRateFast;
63 | _scrollView.backgroundColor = [UIColor blackColor];
64 | }
65 | return _scrollView;
66 | }
67 |
68 |
69 | - (void)didReceiveMemoryWarning {
70 | [super didReceiveMemoryWarning];
71 | // Dispose of any resources that can be recreated.
72 | }
73 |
74 | /*
75 | #pragma mark - Navigation
76 |
77 | // In a storyboard-based application, you will often want to do a little preparation before navigation
78 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
79 | // Get the new view controller using [segue destinationViewController].
80 | // Pass the selected object to the new view controller.
81 | }
82 | */
83 |
84 | @end
85 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCImagePicker.xcdatamodeld/.xccurrentversion:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | _XCCurrentVersionName
6 | CCImagePicker.xcdatamodel
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCImagePicker.xcdatamodeld/CCImagePicker.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCImagePickerViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCImagePickerViewController.h
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCImagePickerViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCPageViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CCPageViewController.h
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCPageViewController : UIViewController
12 |
13 | @property (nonatomic,assign) NSInteger startingIndex;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/CCPageViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCPageViewController.m
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CCPageViewController.h"
10 | #import "CCImageDetailViewController.h"
11 |
12 | @interface CCPageViewController ()
13 |
14 | @property (nonatomic, strong) UIPageViewController *pageController;
15 |
16 | @end
17 |
18 | @implementation CCPageViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | self.edgesForExtendedLayout = UIRectEdgeNone;
23 |
24 | NSDictionary *options = @{UIPageViewControllerOptionSpineLocationKey:[NSNumber numberWithInteger:UIPageViewControllerSpineLocationMin]};
25 | self.pageController = [[UIPageViewController alloc]initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll
26 | navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal
27 | options:options];
28 | self.pageController.dataSource = self;
29 | [self addChildViewController:self.pageController];
30 | [self.view addSubview:self.pageController.view];
31 |
32 | CCImageDetailViewController *startPage = [CCImageDetailViewController previewControllerForPageIndex:self.startingIndex];
33 | if (startPage) {
34 | [self.pageController setViewControllers:@[startPage]
35 | direction:UIPageViewControllerNavigationDirectionForward
36 | animated:NO
37 | completion:NULL];
38 | }
39 | }
40 |
41 | #pragma mark - UIPageViewController DataSource
42 | -(UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
43 | {
44 | NSInteger index = ((CCImageDetailViewController *)viewController).pageIndex;
45 | return [CCImageDetailViewController previewControllerForPageIndex:index - 1];
46 | }
47 |
48 | -(UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
49 | {
50 | NSInteger index = ((CCImageDetailViewController *)viewController).pageIndex;
51 | return [CCImageDetailViewController previewControllerForPageIndex:index + 1];
52 | }
53 |
54 | - (void)didReceiveMemoryWarning {
55 | [super didReceiveMemoryWarning];
56 | // Dispose of any resources that can be recreated.
57 | }
58 |
59 | /*
60 | #pragma mark - Navigation
61 |
62 | // In a storyboard-based application, you will often want to do a little preparation before navigation
63 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
64 | // Get the new view controller using [segue destinationViewController].
65 | // Pass the selected object to the new view controller.
66 | }
67 | */
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | CCIMGPicker
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSPhotoLibraryUsageDescription
28 | YES
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIMainStoryboardFile
32 | Main
33 | UIRequiredDeviceCapabilities
34 |
35 | armv7
36 |
37 | UISupportedInterfaceOrientations
38 |
39 | UIInterfaceOrientationPortrait
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePicker/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // CCImagePicker
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePickerTests/CCImagePickerTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCImagePickerTests.m
3 | // CCImagePickerTests
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCImagePickerTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CCImagePickerTests
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 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePickerTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePickerUITests/CCImagePickerUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCImagePickerUITests.m
3 | // CCImagePickerUITests
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCImagePickerUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CCImagePickerUITests
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 |
--------------------------------------------------------------------------------
/CCImagePicker/CCImagePickerUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/.DS_Store
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCInteractiveTransitionAnimation.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7C85FBE51D6AB518002374C2
16 |
17 | primary
18 |
19 |
20 | 7C85FC011D6AB518002374C2
21 |
22 | primary
23 |
24 |
25 | 7C85FC0C1D6AB518002374C2
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/xcuserdata/cyd.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCInteractiveTransitionAnimation.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | CCInteractiveTransitionAnimation.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 0
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcodeproj/xcuserdata/wsk.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCInteractiveTransitionAnimation.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7C85FBE51D6AB518002374C2
16 |
17 | primary
18 |
19 |
20 | 7C85FC011D6AB518002374C2
21 |
22 | primary
23 |
24 |
25 | 7C85FC0C1D6AB518002374C2
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/AnimationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // AnimationController.h
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AnimationMacro.h"
11 |
12 | @interface AnimationController : UIPercentDrivenInteractiveTransition
13 |
14 | @property (nonatomic, assign, readonly) BOOL interactioning;
15 |
16 | @property (nonatomic, strong) UIViewController *interactiveVC;
17 | @property (nonatomic, assign) InteractiveTransitionType interactiveType;
18 | @property (nonatomic, assign) InteractiveCoverDirection interactiveDirection;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/AnimationMacro.h:
--------------------------------------------------------------------------------
1 | //
2 | // AnimationMacro.h
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #ifndef AnimationMacro_h
10 | #define AnimationMacro_h
11 |
12 | typedef NS_ENUM(NSInteger,InteractiveTransitionType){
13 | InteractiveTransitionTypeCover, //defualt
14 | InteractiveTransitionTypeScale
15 | };
16 |
17 | typedef NS_ENUM(NSInteger,InteractiveCoverDirection) {
18 | InteractiveCoverDirectionRightToLeft, //defualt
19 | InteractiveCoverDirectionLeftToRight,
20 | InteractiveCoverDirectionTopToBottom,
21 | InteractiveCoverDirectionBottomToTop
22 | };
23 |
24 | #endif /* AnimationMacro_h */
25 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | #import "BaseNavigationController.h"
13 |
14 | @interface AppDelegate : UIResponder
15 |
16 | @property (strong, nonatomic) UIWindow *window;
17 |
18 | @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
19 | @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
20 | @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
21 |
22 | - (void)saveContext;
23 | - (NSURL *)applicationDocumentsDirectory;
24 |
25 | @property(nonatomic, strong)BaseNavigationController *navigationController;
26 |
27 | @end
28 |
29 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-58.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-87.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-80.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-120.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-121.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-180.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "1024x1024",
53 | "idiom" : "ios-marketing",
54 | "filename" : "IMG_0784.png",
55 | "scale" : "1x"
56 | }
57 | ],
58 | "info" : {
59 | "version" : 1,
60 | "author" : "xcode"
61 | }
62 | }
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/IMG_0784.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/IMG_0784.png
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-120.png
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-121.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-121.png
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-180.png
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-40.png
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-58.png
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-80.png
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Icon-87.png
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/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 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/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 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/BaseNavigationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // BaseNavigationController.h
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AnimationController.h"
11 |
12 | @interface BaseNavigationController : UINavigationController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/BaseNavigationController.m:
--------------------------------------------------------------------------------
1 | //
2 | // BaseNavigationController.m
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "BaseNavigationController.h"
10 | #import "CoverAnimation.h"
11 | #import "ScaleAnimation.h"
12 |
13 | @interface BaseNavigationController ()
14 | {
15 | AnimationController *_navigationTransition;
16 | CoverAnimation *_coverAnimation;
17 | ScaleAnimation *_scaleAnimation;
18 | }
19 | @property (nonatomic, assign) BOOL reverse;
20 |
21 | @property(nonatomic,assign)InteractiveCoverDirection popDirection;
22 | @property(nonatomic,assign)InteractiveTransitionType interactiveType;
23 | @property(nonatomic,assign)InteractiveCoverDirection pushDirection;
24 |
25 | @end
26 |
27 | @implementation BaseNavigationController
28 |
29 | -(void)viewDidLoad{
30 | [super viewDidLoad];
31 | self.delegate = self;
32 | _navigationTransition = [[AnimationController alloc]init];
33 | _coverAnimation = [[CoverAnimation alloc]init];
34 | _scaleAnimation = [[ScaleAnimation alloc]init];
35 |
36 | // 设置跳转方式
37 | self.interactiveType = InteractiveTransitionTypeCover;
38 |
39 | // 设置跳转方向 当跳转方式为InteractiveTransitionTypeScale时,该属性无效
40 | self.pushDirection = InteractiveCoverDirectionTopToBottom;
41 | }
42 |
43 | -(void)setPushDirection:(InteractiveCoverDirection)pushDirection
44 | {
45 | _pushDirection = pushDirection;
46 | switch (_pushDirection) {
47 | case InteractiveCoverDirectionBottomToTop:
48 | _popDirection = InteractiveCoverDirectionTopToBottom;
49 | break;
50 | case InteractiveCoverDirectionLeftToRight:
51 | _popDirection = InteractiveCoverDirectionRightToLeft;
52 | break;
53 | case InteractiveCoverDirectionRightToLeft:
54 | _popDirection = InteractiveCoverDirectionLeftToRight;
55 | break;
56 | case InteractiveCoverDirectionTopToBottom:
57 | _popDirection = InteractiveCoverDirectionBottomToTop;
58 | break;
59 | default:
60 | break;
61 | }
62 | }
63 |
64 | -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
65 | {
66 | _navigationTransition.interactiveVC = viewController;
67 | _navigationTransition.interactiveDirection = _popDirection;
68 | _navigationTransition.interactiveType = _interactiveType;
69 | }
70 |
71 | -(id)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC
72 | {
73 | if (operation == UINavigationControllerOperationPop){
74 | if (_interactiveType == InteractiveTransitionTypeCover) {
75 | _coverAnimation.direction = _popDirection;
76 | return _coverAnimation;
77 | }
78 | if (_interactiveType == InteractiveTransitionTypeScale) {
79 | return _scaleAnimation;
80 | }
81 | }
82 | else{
83 | if (_interactiveType == InteractiveTransitionTypeCover) {
84 | _coverAnimation.direction = _pushDirection;
85 | return _coverAnimation;
86 | }
87 | if (_interactiveType == InteractiveTransitionTypeScale) {
88 | return _scaleAnimation;
89 | }
90 | }
91 | return nil;
92 | }
93 |
94 | -(id)navigationController:(UINavigationController *)navigationController interactionControllerForAnimationController:(id)animationController
95 | {
96 | return _navigationTransition && _navigationTransition.interactioning ? _navigationTransition : nil;
97 | }
98 |
99 | - (void)didReceiveMemoryWarning {
100 | [super didReceiveMemoryWarning];
101 | // Dispose of any resources that can be recreated.
102 | }
103 |
104 | /*
105 | #pragma mark - Navigation
106 |
107 | // In a storyboard-based application, you will often want to do a little preparation before navigation
108 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
109 | // Get the new view controller using [segue destinationViewController].
110 | // Pass the selected object to the new view controller.
111 | }
112 | */
113 |
114 | @end
115 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcdatamodeld/.xccurrentversion:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | _XCCurrentVersionName
6 | CCInteractiveTransitionAnimation.xcdatamodel
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation.xcdatamodeld/CCInteractiveTransitionAnimation.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/CoverAnimation.h:
--------------------------------------------------------------------------------
1 | //
2 | // CoverAnimation.h
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | #import "AnimationMacro.h"
13 |
14 | @interface CoverAnimation : NSObject
15 |
16 | @property(nonatomic, assign) InteractiveCoverDirection direction;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/CoverAnimation.m:
--------------------------------------------------------------------------------
1 | //
2 | // CoverAnimation.m
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "CoverAnimation.h"
10 |
11 | @implementation CoverAnimation
12 |
13 | -(NSTimeInterval)transitionDuration:(id)transitionContext
14 | {
15 | return 0.3;
16 | }
17 |
18 | -(void)animateTransition:(id)transitionContext
19 | {
20 | UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
21 | UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
22 | [self animateTransition:transitionContext fromVC:fromVC toVC:toVC fromView:fromVC.view toView:toVC.view];
23 | }
24 |
25 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView{
26 | [[transitionContext containerView] addSubview:toView];
27 |
28 | BOOL isPush = ([toVC.navigationController.viewControllers indexOfObject:toVC] > [fromVC.navigationController.viewControllers indexOfObject:fromVC]);
29 |
30 | if (isPush) {
31 | [[transitionContext containerView] bringSubviewToFront:toView];
32 | switch (_direction) {
33 | case InteractiveCoverDirectionLeftToRight:
34 | toView.transform = CGAffineTransformMakeTranslation(-toView.bounds.size.width, 0);
35 | break;
36 | case InteractiveCoverDirectionRightToLeft:
37 | toView.transform = CGAffineTransformMakeTranslation(toView.bounds.size.width, 0);
38 | break;
39 | case InteractiveCoverDirectionBottomToTop:
40 | toView.transform = CGAffineTransformMakeTranslation(0, toView.bounds.size.height);
41 | break;
42 | case InteractiveCoverDirectionTopToBottom:
43 | toView.transform = CGAffineTransformMakeTranslation(0, -toView.bounds.size.height);
44 | break;
45 | default:
46 | break;
47 | }
48 | }
49 | else{
50 | [[transitionContext containerView] bringSubviewToFront:fromView];
51 | }
52 |
53 | [UIView animateWithDuration:[self transitionDuration:transitionContext] animations:^{
54 | if (isPush) {
55 | toView.transform = CGAffineTransformIdentity;
56 | }
57 | else{
58 | switch (_direction) {
59 | case InteractiveCoverDirectionLeftToRight:
60 | fromView.transform = CGAffineTransformMakeTranslation(fromView.bounds.size.width, 0);
61 | break;
62 | case InteractiveCoverDirectionRightToLeft:
63 | fromView.transform = CGAffineTransformMakeTranslation(-fromView.bounds.size.width, 0);
64 | break;
65 | case InteractiveCoverDirectionTopToBottom:
66 | fromView.transform = CGAffineTransformMakeTranslation(0, fromView.bounds.size.height);
67 | break;
68 | case InteractiveCoverDirectionBottomToTop:
69 | fromView.transform = CGAffineTransformMakeTranslation(0, -fromView.bounds.size.height);
70 | break;
71 | default:
72 | break;
73 | }
74 | }
75 | } completion:^(BOOL finished) {
76 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
77 | }];
78 | }
79 |
80 |
81 | @end
82 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | CCTransition
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/ScaleAnimation.h:
--------------------------------------------------------------------------------
1 | //
2 | // ScaleAnimation.h
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface ScaleAnimation : NSObject
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/ScaleAnimation.m:
--------------------------------------------------------------------------------
1 | //
2 | // ScaleAnimation.m
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "ScaleAnimation.h"
10 |
11 | @implementation ScaleAnimation
12 |
13 | -(NSTimeInterval)transitionDuration:(id)transitionContext
14 | {
15 | return 0.3;
16 | }
17 |
18 | -(void)animateTransition:(id)transitionContext
19 | {
20 | UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
21 | UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
22 | [self animateTransition:transitionContext fromVC:fromVC toVC:toVC fromView:fromVC.view toView:toVC.view];
23 | }
24 |
25 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView{
26 | [[transitionContext containerView] addSubview:toView];
27 |
28 | BOOL isPush = ([toVC.navigationController.viewControllers indexOfObject:toVC] > [fromVC.navigationController.viewControllers indexOfObject:fromVC]);
29 |
30 | if (isPush) {
31 | [[transitionContext containerView] bringSubviewToFront:toView];
32 | toView.transform = CGAffineTransformMakeScale(0.3, 0.3);
33 | toView.alpha = 0;
34 | }
35 | else{
36 | [[transitionContext containerView] bringSubviewToFront:fromView];
37 | }
38 |
39 | [UIView animateWithDuration:[self transitionDuration:transitionContext] animations:^{
40 | if (isPush) {
41 | toView.transform = CGAffineTransformIdentity;
42 | toView.alpha = 1;
43 | }
44 | else{
45 | fromView.transform = CGAffineTransformMakeScale(0.3, 0.3);
46 | fromView.alpha = 0;
47 | }
48 | } completion:^(BOOL finished) {
49 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
50 | }];
51 | }
52 |
53 |
54 | @end
55 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 |
15 | @end
16 |
17 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "AppDelegate.h"
11 |
12 | @interface ViewController ()
13 |
14 | @property(nonatomic,assign)NSInteger titleIndex;
15 |
16 | @end
17 |
18 | @implementation ViewController
19 |
20 | -(instancetype)init
21 | {
22 | self = [super init];
23 | if (self) {
24 | self.titleIndex = 0;
25 | }
26 | return self;
27 | }
28 |
29 | - (void)viewDidLoad {
30 | [super viewDidLoad];
31 | NSArray *colors = @[[UIColor purpleColor],[UIColor orangeColor],[UIColor brownColor],[UIColor blueColor],[UIColor greenColor],[UIColor yellowColor],[UIColor redColor]];
32 | self.view.backgroundColor = colors[self.titleIndex%7];
33 |
34 | if(self.titleIndex == 0) {
35 | self.title = @"首页";
36 | }
37 | else{
38 | self.title = [NSString stringWithFormat:@"第%ld页",(long)self.titleIndex];
39 | }
40 | self.titleIndex++;
41 |
42 | UIButton *nextButton = [UIButton buttonWithType:UIButtonTypeSystem];
43 | nextButton.frame = CGRectMake(0, 00, 80, 40);
44 | [nextButton setTitle:@"下一页" forState:UIControlStateNormal];
45 | [nextButton addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
46 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:nextButton];
47 | }
48 |
49 | -(void)buttonClick:(UIButton *)btn{
50 | ViewController *vc = [[ViewController alloc]init];
51 | vc.titleIndex = self.titleIndex;
52 | [self.navigationController pushViewController:vc animated:YES];
53 | }
54 |
55 | - (void)didReceiveMemoryWarning {
56 | [super didReceiveMemoryWarning];
57 | // Dispose of any resources that can be recreated.
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimation/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // CCInteractiveTransitionAnimation
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimationTests/CCInteractiveTransitionAnimationTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCInteractiveTransitionAnimationTests.m
3 | // CCInteractiveTransitionAnimationTests
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCInteractiveTransitionAnimationTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CCInteractiveTransitionAnimationTests
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 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimationTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimationUITests/CCInteractiveTransitionAnimationUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCInteractiveTransitionAnimationUITests.m
3 | // CCInteractiveTransitionAnimationUITests
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCInteractiveTransitionAnimationUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CCInteractiveTransitionAnimationUITests
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 |
--------------------------------------------------------------------------------
/CCInteractiveTransitionAnimation/CCInteractiveTransitionAnimationUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/CCPageViewController/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/.DS_Store
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController.xcodeproj/xcuserdata/cyd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController.xcodeproj/xcuserdata/cyd.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCPageViewController.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | CCPageViewController.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 0
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // CCPageViewController
4 | //
5 | // Created by cyd on 2018/3/23.
6 | // Copyright © 2018年 cyd. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17 | self.window?.rootViewController = UINavigationController(rootViewController: ViewController())
18 | return true
19 | }
20 |
21 | func applicationWillResignActive(_ application: UIApplication) {
22 | // 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.
23 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
24 | }
25 |
26 | func applicationDidEnterBackground(_ application: UIApplication) {
27 | // 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.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | func applicationWillEnterForeground(_ application: UIApplication) {
32 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
33 | }
34 |
35 | func applicationDidBecomeActive(_ application: UIApplication) {
36 | // 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.
37 | }
38 |
39 | func applicationWillTerminate(_ application: UIApplication) {
40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
41 | }
42 |
43 |
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "icon-20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "icon-20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29@2x.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "icon-29@3x.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "icon-40@2x.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "icon-40@3x.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "icon-60@2x.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@3x.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "1024x1024",
53 | "idiom" : "ios-marketing",
54 | "filename" : "icon-1024.png",
55 | "scale" : "1x"
56 | }
57 | ],
58 | "info" : {
59 | "version" : 1,
60 | "author" : "xcode"
61 | }
62 | }
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-1024.png
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCPageViewController/CCPageViewController/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/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 |
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/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 |
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/DetailViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.swift
3 | // CCPageViewController
4 | //
5 | // Created by cyd on 2018/3/23.
6 | // Copyright © 2018年 cyd. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class DetailViewController: UIViewController {
12 |
13 | var index = 0
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 | }
18 |
19 | override func didReceiveMemoryWarning() {
20 | super.didReceiveMemoryWarning()
21 | // Dispose of any resources that can be recreated.
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | CCPageView
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/CCPageViewController/CCPageViewController/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // CCPageViewController
4 | //
5 | // Created by cyd on 2018/3/23.
6 | // Copyright © 2018年 cyd. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController {
12 |
13 | private let colors = [UIColor.blue, UIColor.brown, UIColor.cyan, UIColor.green, UIColor.magenta]
14 |
15 | private var buffer = [DetailViewController]()
16 |
17 | override func viewDidLoad() {
18 | super.viewDidLoad()
19 | self.view.backgroundColor = UIColor.white
20 | self.edgesForExtendedLayout = .init(rawValue: 0)
21 | self.title = "分页控件"
22 | self.setupUI()
23 | }
24 |
25 | private func setupUI() {
26 | let vc = CCPageViewController()
27 | vc.dataSource = self
28 | self.addChildViewController(vc)
29 | self.view.addSubview(vc.view)
30 | }
31 |
32 | private func vc(index: Int) -> UIViewController {
33 | for vc in buffer where vc.index == index {
34 | return vc
35 | }
36 | let vc = DetailViewController()
37 | vc.view.backgroundColor = colors[index%5]
38 | vc.index = index
39 | buffer.append(vc)
40 | return vc
41 | }
42 |
43 | override func didReceiveMemoryWarning() {
44 | super.didReceiveMemoryWarning()
45 | // Dispose of any resources that can be recreated.
46 | }
47 | }
48 |
49 | extension ViewController: CCPageViewControllerDataSource {
50 | func numbersOfPage() -> Int {
51 | return 50
52 | }
53 |
54 | func previewController(formPage index: Int) -> UIViewController {
55 | return self.vc(index: index)
56 | }
57 |
58 | func itemText(index: Int) -> String {
59 | return "第\((index+1).description)页"
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/.DS_Store
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/project.xcworkspace/xcuserdata/baidaojuhe.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/project.xcworkspace/xcuserdata/cyd.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/project.xcworkspace/xcuserdata/wsk.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/xcuserdata/baidaojuhe.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCSildeTabBarController.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7C85FC271D6AB565002374C2
16 |
17 | primary
18 |
19 |
20 | 7C85FC431D6AB565002374C2
21 |
22 | primary
23 |
24 |
25 | 7C85FC4E1D6AB565002374C2
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/xcuserdata/cyd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/xcuserdata/cyd.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCSildeTabBarController.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | CCSildeTabBarController.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 0
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController.xcodeproj/xcuserdata/wsk.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CCSildeTabBarController.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7C85FC271D6AB565002374C2
16 |
17 | primary
18 |
19 |
20 | 7C85FC431D6AB565002374C2
21 |
22 | primary
23 |
24 |
25 | 7C85FC4E1D6AB565002374C2
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // CCSildeTabBarController
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 |
16 | @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
17 | @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
18 | @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
19 |
20 | - (void)saveContext;
21 | - (NSURL *)applicationDocumentsDirectory;
22 |
23 |
24 | @end
25 |
26 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-58.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-87.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-80.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-120.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-121.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-180.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "1024x1024",
53 | "idiom" : "ios-marketing",
54 | "filename" : "IMG_0783.png",
55 | "scale" : "1x"
56 | }
57 | ],
58 | "info" : {
59 | "version" : 1,
60 | "author" : "xcode"
61 | }
62 | }
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/IMG_0783.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/IMG_0783.png
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-120.png
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-121.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-121.png
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-180.png
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-40.png
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-58.png
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-80.png
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cdcyd/CommonControlsCollection/61450b2b2ee9522c80172c7fd1def2ae4882b8bf/CCSildeTabBarController/CCSildeTabBarController/Assets.xcassets/AppIcon.appiconset/Icon-87.png
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/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 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/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 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/BaseViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.h
3 | // CCSildeTabBarController
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface BaseViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/BaseViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.m
3 | // CCSildeTabBarController
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface BaseViewController ()
12 |
13 | @end
14 |
15 | @implementation BaseViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | self.edgesForExtendedLayout = UIRectEdgeNone;
20 | self.view.backgroundColor = [UIColor whiteColor];
21 | }
22 |
23 | - (void)didReceiveMemoryWarning {
24 | [super didReceiveMemoryWarning];
25 | // Dispose of any resources that can be recreated.
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/CCSildeTabBarController.xcdatamodeld/.xccurrentversion:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | _XCCurrentVersionName
6 | CCSildeTabBarController.xcdatamodel
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/CCSildeTabBarController.xcdatamodeld/CCSildeTabBarController.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/DetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.h
3 | // CCSildeTabBarController
4 | //
5 | // Created by cyd on 2018/9/4.
6 | // Copyright © 2018 cyd. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface DetailViewController : BaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/DetailViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.m
3 | // CCSildeTabBarController
4 | //
5 | // Created by cyd on 2018/9/4.
6 | // Copyright © 2018 cyd. All rights reserved.
7 | //
8 |
9 | #import "DetailViewController.h"
10 |
11 | @interface DetailViewController ()
12 |
13 | @end
14 |
15 | @implementation DetailViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 | }
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | CCSildeTabBar
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/MainTabBarViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainTabBarViewController.h
3 | // CCSildeTabBarController
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MainTabBarViewController : UITabBarController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/NavigationViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // NavigationViewController.h
3 | // CCSildeTabBarController
4 | //
5 | // Created by cyd on 2018/9/4.
6 | // Copyright © 2018 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface NavigationViewController : UINavigationController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/NavigationViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // NavigationViewController.m
3 | // CCSildeTabBarController
4 | //
5 | // Created by cyd on 2018/9/4.
6 | // Copyright © 2018 cyd. All rights reserved.
7 | //
8 |
9 | #import "NavigationViewController.h"
10 | #import "MainTabBarViewController.h"
11 |
12 | @implementation NavigationViewController
13 |
14 | -(void)viewDidLoad {
15 | [super viewDidLoad];
16 | self.delegate = self;
17 | }
18 |
19 | -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
20 | // BOOL ishide = [viewController isKindOfClass: MainTabBarViewController.class];
21 | // [self setNavigationBarHidden:ishide animated:true];
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/TransitionAnimation.h:
--------------------------------------------------------------------------------
1 | //
2 | // TransitionAnimation.h
3 | // CCSildeTabBarController
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface TransitionAnimation : NSObject
12 |
13 | - (instancetype)initWithTargetEdge:(UIRectEdge)targetEdge;
14 |
15 | @property (nonatomic, readwrite) UIRectEdge targetEdge;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/TransitionAnimation.m:
--------------------------------------------------------------------------------
1 | //
2 | // TransitionAnimation.m
3 | // CCSildeTabBarController
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "TransitionAnimation.h"
10 |
11 | @implementation TransitionAnimation
12 |
13 | - (instancetype)initWithTargetEdge:(UIRectEdge)targetEdge{
14 | self = [self init];
15 | if (self) {
16 | _targetEdge = targetEdge;
17 | }
18 | return self;
19 | }
20 |
21 | - (NSTimeInterval)transitionDuration:(id)transitionContext{
22 | return 0.35;
23 | }
24 |
25 | - (void)animateTransition:(id)transitionContext{
26 | UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
27 | UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
28 |
29 |
30 | UIView *fromView = [transitionContext viewForKey:UITransitionContextFromViewKey];
31 | UIView *toView = [transitionContext viewForKey:UITransitionContextToViewKey];
32 |
33 | CGRect fromFrame = [transitionContext initialFrameForViewController:fromViewController];
34 | CGRect toFrame = [transitionContext finalFrameForViewController:toViewController];
35 |
36 | CGVector offset;
37 | if (self.targetEdge == UIRectEdgeLeft){
38 | offset = CGVectorMake(-1.f, 0.f);
39 | }
40 | else if (self.targetEdge == UIRectEdgeRight){
41 | offset = CGVectorMake(1.f, 0.f);
42 | }
43 | else{
44 | NSAssert(NO, @"targetEdge must be one of UIRectEdgeLeft, or UIRectEdgeRight.");
45 | }
46 |
47 | fromView.frame = fromFrame;
48 | toView.frame = CGRectOffset(toFrame,
49 | toFrame.size.width * offset.dx * -1,
50 | toFrame.size.height * offset.dy * -1);
51 |
52 | [transitionContext.containerView addSubview:toView];
53 | NSTimeInterval transitionDuration = [self transitionDuration:transitionContext];
54 | [UIView animateWithDuration:transitionDuration animations:^{
55 | fromView.frame = CGRectOffset(fromFrame,
56 | fromFrame.size.width * offset.dx,
57 | fromFrame.size.height * offset.dy);
58 | toView.frame = toFrame;
59 | } completion:^(BOOL finished) {
60 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
61 | }];
62 | }
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/TransitionController.h:
--------------------------------------------------------------------------------
1 | //
2 | // TransitionController.h
3 | // CCSildeTabBarController
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface TransitionController : UIPercentDrivenInteractiveTransition
12 |
13 | - (instancetype)initWithGestureRecognizer:(UIPanGestureRecognizer *)gestureRecognizer NS_DESIGNATED_INITIALIZER;
14 |
15 | - (instancetype)init NS_UNAVAILABLE;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/TransitionController.m:
--------------------------------------------------------------------------------
1 | //
2 | // TransitionController.m
3 | // CCSildeTabBarController
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import "TransitionController.h"
10 |
11 | @interface TransitionController()
12 |
13 | @property (nonatomic, weak) id transitionContext;
14 |
15 | @property (nonatomic, strong, readonly) UIPanGestureRecognizer *gestureRecognizer;
16 |
17 | @property (nonatomic, readwrite) CGPoint initialTranslationInContainerView;
18 |
19 | @end
20 |
21 | @implementation TransitionController
22 |
23 | - (instancetype)initWithGestureRecognizer:(UIPanGestureRecognizer *)gestureRecognizer{
24 | self = [super init];
25 | if (self){
26 | _gestureRecognizer = gestureRecognizer;
27 | [_gestureRecognizer addTarget:self action:@selector(gestureRecognizeDidUpdate:)];
28 | }
29 | return self;
30 | }
31 |
32 | - (instancetype)init{
33 | @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Use -initWithGestureRecognizer:" userInfo:nil];
34 | }
35 |
36 | - (void)dealloc{
37 | [self.gestureRecognizer removeTarget:self action:@selector(gestureRecognizeDidUpdate:)];
38 | }
39 |
40 | - (void)startInteractiveTransition:(id)transitionContext{
41 | self.transitionContext = transitionContext;
42 | self.initialTranslationInContainerView = [self.gestureRecognizer translationInView:transitionContext.containerView];
43 | [super startInteractiveTransition:transitionContext];
44 | }
45 |
46 | - (CGFloat)percentForGesture:(UIPanGestureRecognizer *)gesture{
47 | UIView *transitionContainerView = self.transitionContext.containerView;
48 | CGPoint translation = [gesture translationInView:gesture.view.superview];
49 | if ((translation.x > 0.f && self.initialTranslationInContainerView.x < 0.f) ||
50 | (translation.x < 0.f && self.initialTranslationInContainerView.x > 0.f)){
51 | return -1.f;
52 | }
53 | return fabs(translation.x)/CGRectGetWidth(transitionContainerView.bounds);
54 | }
55 |
56 | - (void)gestureRecognizeDidUpdate:(UIScreenEdgePanGestureRecognizer *)gestureRecognizer{
57 | switch (gestureRecognizer.state) {
58 | case UIGestureRecognizerStateBegan:
59 | break;
60 | case UIGestureRecognizerStateChanged:
61 | if ([self percentForGesture:gestureRecognizer] < 0.f) {
62 | [self cancelInteractiveTransition];
63 | [self.gestureRecognizer removeTarget:self action:@selector(gestureRecognizeDidUpdate:)];
64 | }
65 | else {
66 | [self updateInteractiveTransition:[self percentForGesture:gestureRecognizer]];
67 | }
68 | break;
69 | case UIGestureRecognizerStateEnded:
70 | if ([self percentForGesture:gestureRecognizer] >= 0.4f){
71 | [self finishInteractiveTransition];
72 | }
73 | else{
74 | [self cancelInteractiveTransition];
75 | }
76 | break;
77 | default:
78 | [self cancelInteractiveTransition];
79 | break;
80 | }
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // CCSildeTabBarController
4 | //
5 | // Created by cyd on 2018/9/4.
6 | // Copyright © 2018 cyd. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface ViewController : BaseViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // CCSildeTabBarController
4 | //
5 | // Created by cyd on 2018/9/4.
6 | // Copyright © 2018 cyd. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "DetailViewController.h"
11 |
12 | @interface ViewController ()
13 |
14 | @end
15 |
16 | @implementation ViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | // Do any additional setup after loading the view.
21 | }
22 |
23 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
24 | // [self.navigationController pushViewController:[[DetailViewController alloc] init] animated:true];
25 | }
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarController/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // CCSildeTabBarController
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarControllerTests/CCSildeTabBarControllerTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCSildeTabBarControllerTests.m
3 | // CCSildeTabBarControllerTests
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCSildeTabBarControllerTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CCSildeTabBarControllerTests
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 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarControllerTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarControllerUITests/CCSildeTabBarControllerUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CCSildeTabBarControllerUITests.m
3 | // CCSildeTabBarControllerUITests
4 | //
5 | // Created by wsk on 16/8/22.
6 | // Copyright © 2016年 cyd. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CCSildeTabBarControllerUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CCSildeTabBarControllerUITests
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 |
--------------------------------------------------------------------------------
/CCSildeTabBarController/CCSildeTabBarControllerUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## CommonControlsCollection iOS常用控件集合
2 |
3 | 1. CCImagePicker 自定义照片选择器
4 |
5 | + 参考了苹果官方Demo,高效、实用,用UIPageViewController+ScollView使滚动查看多张照片时,占用较少内存资源
6 |
7 | 2. CCInteractiveTransitionAnimation 自定义导航动画
8 |
9 | + 实现了自定义的导航跳转动画,并且动画可交互
10 |
11 | 3. CCSildeTabBarController自定义TabBarController
12 |
13 | + 自定义一个可以左右滑动切换视图的TabBarController,并且切换动画可以交互
14 |
15 | 4. CCButton
16 |
17 | + 自定义Button
18 |
19 | 5. CCCalendar
20 |
21 | + 自定义日历,高度模仿了苹果原生系统的无限滑动效果,支持单选和多选
22 |
23 | 6. CCPageViewController
24 |
25 | + 分页控件
26 |
27 | 7. 持续更新中...
28 |
--------------------------------------------------------------------------------