├── .DS_Store
├── .gitignore
├── CollectionViewDemo
├── .DS_Store
├── CollectionViewDemo.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── CollectionViewDemo.xcworkspace
│ └── contents.xcworkspacedata
├── CollectionViewDemo
│ ├── .DS_Store
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ └── DOTA2 Pic
│ │ │ ├── Contents.json
│ │ │ ├── DOTA2_0.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_0.jpg
│ │ │ ├── DOTA2_1.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_1.jpg
│ │ │ ├── DOTA2_10.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_10.jpg
│ │ │ ├── DOTA2_11.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_11.jpg
│ │ │ ├── DOTA2_12.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_12.jpg
│ │ │ ├── DOTA2_13.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_13.jpg
│ │ │ ├── DOTA2_14.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_14.jpg
│ │ │ ├── DOTA2_15.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_15.jpg
│ │ │ ├── DOTA2_16.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_16.jpg
│ │ │ ├── DOTA2_17.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_17.jpg
│ │ │ ├── DOTA2_18.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_18.jpg
│ │ │ ├── DOTA2_19.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_19.jpg
│ │ │ ├── DOTA2_2.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_2.jpg
│ │ │ ├── DOTA2_20.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_20.jpg
│ │ │ ├── DOTA2_21.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_21.jpg
│ │ │ ├── DOTA2_22.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_22.jpg
│ │ │ ├── DOTA2_23.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_23.jpg
│ │ │ ├── DOTA2_24.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_24.jpg
│ │ │ ├── DOTA2_25.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_25.jpg
│ │ │ ├── DOTA2_26.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_26.jpg
│ │ │ ├── DOTA2_27.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_27.jpg
│ │ │ ├── DOTA2_28.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_28.jpg
│ │ │ ├── DOTA2_29.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_29.jpg
│ │ │ ├── DOTA2_3.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_3.jpg
│ │ │ ├── DOTA2_30.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_30.jpg
│ │ │ ├── DOTA2_4.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_4.jpg
│ │ │ ├── DOTA2_5.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_5.jpg
│ │ │ ├── DOTA2_6.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_6.jpg
│ │ │ ├── DOTA2_7.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_7.jpg
│ │ │ ├── DOTA2_8.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_8.jpg
│ │ │ ├── DOTA2_9.imageset
│ │ │ ├── Contents.json
│ │ │ └── DOTA2_9.jpg
│ │ │ ├── dota2-0.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-0.jpg
│ │ │ ├── dota2-1.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-1.jpg
│ │ │ ├── dota2-10.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-10.jpg
│ │ │ ├── dota2-11.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-11.jpg
│ │ │ ├── dota2-12.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-12.jpg
│ │ │ ├── dota2-13.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-13.jpg
│ │ │ ├── dota2-2.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-2.jpg
│ │ │ ├── dota2-3.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-3.jpg
│ │ │ ├── dota2-4.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-4.jpg
│ │ │ ├── dota2-5.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-5.jpg
│ │ │ ├── dota2-6.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-6.jpg
│ │ │ ├── dota2-7.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-7.jpg
│ │ │ ├── dota2-8.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-8.jpg
│ │ │ └── dota2-9.imageset
│ │ │ ├── Contents.json
│ │ │ └── dota2-9.jpg
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── HomeTableViewController.swift
│ ├── Info.plist
│ ├── Model
│ │ └── DataModel.swift
│ ├── 基本流水布局-storyboard
│ │ ├── .DS_Store
│ │ ├── BaseCollectionViewController.swift
│ │ ├── BaseDetailViewController.swift
│ │ ├── FooterCollectionReusableView.swift
│ │ ├── HeaderCollectionReusableView.swift
│ │ └── ImageCell.swift
│ ├── 基本流水布局-代码
│ │ ├── BaseViewController.swift
│ │ ├── ImageCollectionViewCell.swift
│ │ └── ImageCollectionViewCell.xib
│ ├── 线性布局和圆形布局
│ │ ├── CircleLayout.swift
│ │ ├── LineCell.swift
│ │ ├── LineCell.xib
│ │ ├── LineLayout.swift
│ │ └── LineViewController.swift
│ ├── 自定义动画
│ │ ├── ColorViewCell.swift
│ │ ├── ColorViewCell.xib
│ │ ├── PubuLayout.swift
│ │ └── PubuViewController.swift
│ └── 自定义瀑布流布局
│ │ ├── MyWaterfallCell.swift
│ │ ├── MyWaterfallCell.xib
│ │ ├── WaterfallLayouDelegate.swift
│ │ ├── WaterfallLayout.swift
│ │ └── WaterfallViewController.swift
├── Podfile
├── Podfile.lock
└── Pods
│ ├── MJRefresh
│ ├── LICENSE
│ ├── MJRefresh
│ │ ├── Base
│ │ │ ├── MJRefreshAutoFooter.h
│ │ │ ├── MJRefreshAutoFooter.m
│ │ │ ├── MJRefreshBackFooter.h
│ │ │ ├── MJRefreshBackFooter.m
│ │ │ ├── MJRefreshComponent.h
│ │ │ ├── MJRefreshComponent.m
│ │ │ ├── MJRefreshFooter.h
│ │ │ ├── MJRefreshFooter.m
│ │ │ ├── MJRefreshHeader.h
│ │ │ └── MJRefreshHeader.m
│ │ ├── Custom
│ │ │ ├── Footer
│ │ │ │ ├── Auto
│ │ │ │ │ ├── MJRefreshAutoGifFooter.h
│ │ │ │ │ ├── MJRefreshAutoGifFooter.m
│ │ │ │ │ ├── MJRefreshAutoNormalFooter.h
│ │ │ │ │ ├── MJRefreshAutoNormalFooter.m
│ │ │ │ │ ├── MJRefreshAutoStateFooter.h
│ │ │ │ │ └── MJRefreshAutoStateFooter.m
│ │ │ │ └── Back
│ │ │ │ │ ├── MJRefreshBackGifFooter.h
│ │ │ │ │ ├── MJRefreshBackGifFooter.m
│ │ │ │ │ ├── MJRefreshBackNormalFooter.h
│ │ │ │ │ ├── MJRefreshBackNormalFooter.m
│ │ │ │ │ ├── MJRefreshBackStateFooter.h
│ │ │ │ │ └── MJRefreshBackStateFooter.m
│ │ │ └── Header
│ │ │ │ ├── MJRefreshGifHeader.h
│ │ │ │ ├── MJRefreshGifHeader.m
│ │ │ │ ├── MJRefreshNormalHeader.h
│ │ │ │ ├── MJRefreshNormalHeader.m
│ │ │ │ ├── MJRefreshStateHeader.h
│ │ │ │ └── MJRefreshStateHeader.m
│ │ ├── MJRefresh.bundle
│ │ │ ├── arrow@2x.png
│ │ │ ├── en.lproj
│ │ │ │ └── Localizable.strings
│ │ │ ├── zh-Hans.lproj
│ │ │ │ └── Localizable.strings
│ │ │ └── zh-Hant.lproj
│ │ │ │ └── Localizable.strings
│ │ ├── MJRefresh.h
│ │ ├── MJRefreshConst.h
│ │ ├── MJRefreshConst.m
│ │ ├── NSBundle+MJRefresh.h
│ │ ├── NSBundle+MJRefresh.m
│ │ ├── UIScrollView+MJExtension.h
│ │ ├── UIScrollView+MJExtension.m
│ │ ├── UIScrollView+MJRefresh.h
│ │ ├── UIScrollView+MJRefresh.m
│ │ ├── UIView+MJExtension.h
│ │ └── UIView+MJExtension.m
│ └── README.md
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ └── project.pbxproj
│ ├── RandomColorSwift
│ ├── LICENSE
│ ├── README.md
│ └── RandomColor
│ │ ├── ColorDefinition.swift
│ │ ├── Hue.swift
│ │ ├── Luminosity.swift
│ │ └── RandomColor.swift
│ ├── SnapKit
│ ├── LICENSE
│ ├── README.md
│ └── Source
│ │ ├── Constraint.swift
│ │ ├── ConstraintAttributes.swift
│ │ ├── ConstraintDescription.swift
│ │ ├── ConstraintItem.swift
│ │ ├── ConstraintMaker.swift
│ │ ├── ConstraintRelation.swift
│ │ ├── Debugging.swift
│ │ ├── EdgeInsets.swift
│ │ ├── LayoutConstraint.swift
│ │ ├── SnapKit.swift
│ │ ├── View+SnapKit.swift
│ │ └── ViewController+SnapKit.swift
│ └── Target Support Files
│ ├── MJRefresh
│ ├── Info.plist
│ ├── MJRefresh-dummy.m
│ ├── MJRefresh-prefix.pch
│ ├── MJRefresh-umbrella.h
│ ├── MJRefresh.modulemap
│ └── MJRefresh.xcconfig
│ ├── Pods-CollectionViewDemo
│ ├── Info.plist
│ ├── Pods-CollectionViewDemo-acknowledgements.markdown
│ ├── Pods-CollectionViewDemo-acknowledgements.plist
│ ├── Pods-CollectionViewDemo-dummy.m
│ ├── Pods-CollectionViewDemo-frameworks.sh
│ ├── Pods-CollectionViewDemo-resources.sh
│ ├── Pods-CollectionViewDemo-umbrella.h
│ ├── Pods-CollectionViewDemo.debug.xcconfig
│ ├── Pods-CollectionViewDemo.modulemap
│ └── Pods-CollectionViewDemo.release.xcconfig
│ ├── RandomColorSwift
│ ├── Info.plist
│ ├── RandomColorSwift-dummy.m
│ ├── RandomColorSwift-prefix.pch
│ ├── RandomColorSwift-umbrella.h
│ ├── RandomColorSwift.modulemap
│ └── RandomColorSwift.xcconfig
│ └── SnapKit
│ ├── Info.plist
│ ├── SnapKit-dummy.m
│ ├── SnapKit-prefix.pch
│ ├── SnapKit-umbrella.h
│ ├── SnapKit.modulemap
│ └── SnapKit.xcconfig
├── README.md
├── 事件传递及响应Demo
├── .DS_Store
├── 事件传递及响应Demo.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
└── 事件传递及响应Demo
│ ├── .DS_Store
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── ViewController.swift
│ ├── demo1
│ ├── .DS_Store
│ ├── BaseView.swift
│ ├── BlueView.swift
│ ├── GreenView.swift
│ ├── MyUIwindow.swift
│ ├── OrangeView.swift
│ ├── RedView.swift
│ ├── WhiteView.swift
│ └── YellowView.swift
│ └── demo2
│ ├── Demo2ViewController.swift
│ └── Yellow2View.swift
└── 动画学习Demo
├── 动画学习Demo.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ └── contents.xcworkspacedata
└── 动画学习Demo
├── Animation01ViewController.swift
├── Animation02ViewController.swift
├── Animation03ViewController.swift
├── Animation04ViewController.swift
├── Animation05ViewController.swift
├── AppDelegate.swift
├── Assets.xcassets
├── AppIcon.appiconset
│ └── Contents.json
├── Contents.json
└── dota2-0.imageset
│ ├── Contents.json
│ └── dota2-0.jpg
├── Base.lproj
├── Animation01.storyboard
├── LaunchScreen.storyboard
└── Main.storyboard
├── HomeTableViewController.swift
└── Info.plist
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/.DS_Store
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xcuserstate
23 |
24 | ## Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 | *.dSYM.zip
28 | *.dSYM
29 |
30 | ## Playgrounds
31 | timeline.xctimeline
32 | playground.xcworkspace
33 |
34 | # Swift Package Manager
35 | #
36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
37 | # Packages/
38 | .build/
39 |
40 | # CocoaPods
41 | #
42 | # We recommend against adding the Pods directory to your .gitignore. However
43 | # you should judge for yourself, the pros and cons are mentioned at:
44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
45 | #
46 | # Pods/
47 |
48 | # Carthage
49 | #
50 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
51 | # Carthage/Checkouts
52 |
53 | Carthage/Build
54 |
55 | # fastlane
56 | #
57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
58 | # screenshots whenever they are needed.
59 | # For more information about the recommended setup visit:
60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
61 |
62 | fastlane/report.xml
63 | fastlane/Preview.html
64 | fastlane/screenshots
65 | fastlane/test_output
66 |
--------------------------------------------------------------------------------
/CollectionViewDemo/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/.DS_Store
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/.DS_Store
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/28.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import RandomColorSwift
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18 |
19 | //初始化数据
20 | InitDataModel()
21 | for _ in 0...40 {
22 | colors.append(randomColor())
23 |
24 | }
25 |
26 |
27 | return true
28 | }
29 |
30 | func applicationWillResignActive(application: UIApplication) {
31 | // 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.
32 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
33 | }
34 |
35 | func applicationDidEnterBackground(application: UIApplication) {
36 | // 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.
37 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
38 | }
39 |
40 | func applicationWillEnterForeground(application: UIApplication) {
41 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
42 | }
43 |
44 | func applicationDidBecomeActive(application: UIApplication) {
45 | // 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.
46 | }
47 |
48 | func applicationWillTerminate(application: UIApplication) {
49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
50 | }
51 |
52 |
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_0.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_0.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_0.imageset/DOTA2_0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_0.imageset/DOTA2_0.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_1.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_1.imageset/DOTA2_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_1.imageset/DOTA2_1.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_10.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_10.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_10.imageset/DOTA2_10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_10.imageset/DOTA2_10.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_11.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_11.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_11.imageset/DOTA2_11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_11.imageset/DOTA2_11.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_12.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_12.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_12.imageset/DOTA2_12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_12.imageset/DOTA2_12.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_13.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_13.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_13.imageset/DOTA2_13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_13.imageset/DOTA2_13.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_14.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_14.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_14.imageset/DOTA2_14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_14.imageset/DOTA2_14.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_15.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_15.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_15.imageset/DOTA2_15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_15.imageset/DOTA2_15.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_16.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_16.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_16.imageset/DOTA2_16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_16.imageset/DOTA2_16.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_17.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_17.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_17.imageset/DOTA2_17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_17.imageset/DOTA2_17.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_18.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_18.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_18.imageset/DOTA2_18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_18.imageset/DOTA2_18.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_19.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_19.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_19.imageset/DOTA2_19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_19.imageset/DOTA2_19.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_2.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_2.imageset/DOTA2_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_2.imageset/DOTA2_2.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_20.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_20.imageset/DOTA2_20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_20.imageset/DOTA2_20.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_21.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_21.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_21.imageset/DOTA2_21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_21.imageset/DOTA2_21.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_22.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_22.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_22.imageset/DOTA2_22.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_22.imageset/DOTA2_22.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_23.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_23.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_23.imageset/DOTA2_23.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_23.imageset/DOTA2_23.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_24.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_24.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_24.imageset/DOTA2_24.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_24.imageset/DOTA2_24.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_25.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_25.imageset/DOTA2_25.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_25.imageset/DOTA2_25.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_26.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_26.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_26.imageset/DOTA2_26.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_26.imageset/DOTA2_26.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_27.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_27.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_27.imageset/DOTA2_27.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_27.imageset/DOTA2_27.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_28.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_28.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_28.imageset/DOTA2_28.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_28.imageset/DOTA2_28.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_29.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_29.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_29.imageset/DOTA2_29.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_29.imageset/DOTA2_29.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_3.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_3.imageset/DOTA2_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_3.imageset/DOTA2_3.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_30.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_30.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_30.imageset/DOTA2_30.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_30.imageset/DOTA2_30.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_4.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_4.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_4.imageset/DOTA2_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_4.imageset/DOTA2_4.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_5.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_5.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_5.imageset/DOTA2_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_5.imageset/DOTA2_5.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_6.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_6.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_6.imageset/DOTA2_6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_6.imageset/DOTA2_6.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_7.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_7.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_7.imageset/DOTA2_7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_7.imageset/DOTA2_7.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_8.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_8.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_8.imageset/DOTA2_8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_8.imageset/DOTA2_8.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_9.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "DOTA2_9.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_9.imageset/DOTA2_9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/DOTA2_9.imageset/DOTA2_9.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-0.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-0.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-0.imageset/dota2-0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-0.imageset/dota2-0.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-1.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-1.imageset/dota2-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-1.imageset/dota2-1.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-10.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-10.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-10.imageset/dota2-10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-10.imageset/dota2-10.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-11.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-11.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-11.imageset/dota2-11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-11.imageset/dota2-11.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-12.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-12.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-12.imageset/dota2-12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-12.imageset/dota2-12.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-13.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-13.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-13.imageset/dota2-13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-13.imageset/dota2-13.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-2.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-2.imageset/dota2-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-2.imageset/dota2-2.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-3.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-3.imageset/dota2-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-3.imageset/dota2-3.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-4.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-4.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-4.imageset/dota2-4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-4.imageset/dota2-4.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-5.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-5.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-5.imageset/dota2-5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-5.imageset/dota2-5.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-6.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-6.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-6.imageset/dota2-6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-6.imageset/dota2-6.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-7.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-7.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-7.imageset/dota2-7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-7.imageset/dota2-7.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-8.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-8.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-8.imageset/dota2-8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-8.imageset/dota2-8.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-9.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-9.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-9.imageset/dota2-9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/Assets.xcassets/DOTA2 Pic/dota2-9.imageset/dota2-9.jpg
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/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 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/HomeTableViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HomeTableViewController.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/28.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class HomeTableViewController: UITableViewController {
12 |
13 | var datas: [String] = ["1. 最基本的流水线布局 - Storyboard", "2. 最基本的流水线布局 - 代码", "3. 自定义插入、删除 cell 的动画", "4. 线性布局和圆形布局", "5. 瀑布流布局"]
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 |
18 | title = "几种不同的 CollectionView 布局"
19 |
20 |
21 |
22 |
23 | }
24 |
25 | override func didReceiveMemoryWarning() {
26 | super.didReceiveMemoryWarning()
27 | // Dispose of any resources that can be recreated.
28 | }
29 |
30 | // MARK: - Table view data source
31 |
32 | override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
33 | // #warning Incomplete implementation, return the number of sections
34 | return 1
35 | }
36 |
37 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
38 | // #warning Incomplete implementation, return the number of rows
39 | return datas.count
40 | }
41 |
42 |
43 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
44 | //直接使用storyboard中的cell,可以不用注册cell。如果自定义cell或者nib实现cell,均需要注册cell。
45 | //tableView.registerNib(nib: UINib?, forCellReuseIdentifier: String)
46 | //tableView.registerClass(cellClass: AnyClass?, forCellReuseIdentifier: String)
47 |
48 | let cell = tableView.dequeueReusableCellWithIdentifier("datasCell", forIndexPath: indexPath)
49 |
50 | cell.textLabel?.text = datas[indexPath.row]
51 |
52 | return cell
53 | }
54 |
55 | // MARK: - Table view Data Delegate
56 |
57 | override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
58 | switch indexPath.row {
59 | case 0:
60 | performSegueWithIdentifier("toBaseColletciton", sender: nil)
61 | case 1:
62 | performSegueWithIdentifier("toBaseCode", sender: nil)
63 | case 2:
64 | performSegueWithIdentifier("toPubu", sender: nil)
65 | case 3:
66 | performSegueWithIdentifier("toLine", sender: nil)
67 | case 4:
68 | performSegueWithIdentifier("toWaterfall", sender: nil)
69 | default:
70 | print("default")
71 | }
72 | }
73 |
74 |
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/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 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/Model/DataModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DataModel.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/28.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 |
12 |
13 | var dota2Avart:[String] = [String]()
14 | var dota2Pic: [String] = [String]()
15 |
16 | var colors:[UIColor] = [UIColor]()
17 |
18 | func InitDataModel() {
19 |
20 | //简单的初始化两个数组后面使用
21 |
22 | for i in 0...30 {
23 |
24 | dota2Pic.append("DOTA2_" + "\(i)")
25 | }
26 | for i in 0...13 {
27 | dota2Avart.append("dota2-" + "\(i)")
28 | }
29 | }
30 |
31 | //准备数据,存储随机颜色
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/基本流水布局-storyboard/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/CollectionViewDemo/基本流水布局-storyboard/.DS_Store
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/基本流水布局-storyboard/BaseDetailViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseDetailViewController.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/28.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class BaseDetailViewController: UIViewController {
12 | @IBOutlet weak var detailImageView: UIImageView!
13 | var imageName: String!
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 |
18 | detailImageView.image = UIImage(named: imageName)
19 | }
20 |
21 | override func didReceiveMemoryWarning() {
22 | super.didReceiveMemoryWarning()
23 | // Dispose of any resources that can be recreated.
24 | }
25 |
26 |
27 | /*
28 | // MARK: - Navigation
29 |
30 | // In a storyboard-based application, you will often want to do a little preparation before navigation
31 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
32 | // Get the new view controller using segue.destinationViewController.
33 | // Pass the selected object to the new view controller.
34 | }
35 | */
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/基本流水布局-storyboard/FooterCollectionReusableView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // FooterCollectionReusableView.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/28.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class FooterCollectionReusableView: UICollectionReusableView {
12 |
13 | @IBOutlet weak var footerLabel: UILabel!
14 |
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/基本流水布局-storyboard/HeaderCollectionReusableView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HeaderCollectionReusableView.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/28.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class HeaderCollectionReusableView: UICollectionReusableView {
12 | @IBOutlet weak var headLabel: UILabel!
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/基本流水布局-storyboard/ImageCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ImageCell.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/28.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ImageCell: UICollectionViewCell {
12 |
13 | @IBOutlet weak var dotaImageView: UIImageView!
14 | @IBOutlet weak var nameLabel: UILabel!
15 |
16 |
17 | override func awakeFromNib() {
18 | super.awakeFromNib()
19 | self.backgroundColor = UIColor.orangeColor()
20 | }
21 |
22 |
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/基本流水布局-代码/ImageCollectionViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ImageCollectionViewCell.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/28.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ImageCollectionViewCell: UICollectionViewCell {
12 |
13 | @IBOutlet weak var imageView: UIImageView!
14 | @IBOutlet weak var nameLabel: UILabel!
15 | override func awakeFromNib() {
16 | super.awakeFromNib()
17 | // Initialization code
18 | backgroundColor = UIColor.cyanColor()
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/基本流水布局-代码/ImageCollectionViewCell.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/线性布局和圆形布局/CircleLayout.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CircleLayout.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/30.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class CircleLayout: UICollectionViewLayout {
12 |
13 | private var attrsArray = [UICollectionViewLayoutAttributes]() //用于存储布局属性
14 |
15 | override init() {
16 | super.init()
17 | }
18 |
19 | required init?(coder aDecoder: NSCoder) {
20 | fatalError("init(coder:) has not been implemented")
21 | }
22 |
23 |
24 | override func prepareLayout() {
25 | super.prepareLayout()
26 | attrsArray.removeAll()
27 | let number = collectionView!.numberOfItemsInSection(0)
28 |
29 | for i in 0 ..< number {
30 | let indexPath = NSIndexPath(forItem: i, inSection: 0)
31 | let attributes = layoutAttributesForItemAtIndexPath(indexPath)!
32 | attrsArray.append(attributes)
33 |
34 | }
35 |
36 | }
37 |
38 | //这个方法返回的是在rect范围内的布局属性,一般利用layoutAttributesForItemAtIndexPath的结果
39 | override func layoutAttributesForElementsInRect(rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
40 | return attrsArray
41 | }
42 |
43 | // 这个方法需要返回indexPath位置对应的cell 的布局属性
44 |
45 | override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? {
46 | let attrs: UICollectionViewLayoutAttributes = UICollectionViewLayoutAttributes(forCellWithIndexPath: indexPath)
47 |
48 | let number = collectionView?.numberOfItemsInSection(0)
49 | let radius: CGFloat = 80
50 | //圆心位置
51 | let oX: CGFloat = collectionView!.frame.size.width * 0.5
52 | let oY: CGFloat = collectionView!.frame.size.height * 0.5
53 |
54 | attrs.size = CGSizeMake(60, 60)
55 | if number == 1 {
56 | attrs.center = CGPointMake(oX, oY)
57 | }else {
58 | let angle: CGFloat = (2 * CGFloat(M_PI) / CGFloat(number!)) * CGFloat(indexPath.item)
59 | let centerX: CGFloat = oX + radius * cos(angle)
60 | let centerY: CGFloat = oY - radius * sin(angle)
61 | attrs.center = CGPointMake(centerX, centerY)
62 | }
63 | return attrs
64 |
65 |
66 | }
67 |
68 |
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/线性布局和圆形布局/LineCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LineCell.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/30.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class LineCell: UICollectionViewCell {
12 |
13 | @IBOutlet weak var lineImageView: UIImageView!
14 |
15 |
16 | override func awakeFromNib() {
17 | super.awakeFromNib()
18 | // Initialization code
19 | //给图片加上边框效果
20 | // layer.borderColor = UIColor.blackColor().CGColor
21 | // layer.borderWidth = 4.0
22 |
23 | layer.cornerRadius = 30
24 | layer.masksToBounds = true
25 | layer.borderWidth = 1
26 | layer.borderColor = UIColor.blackColor().CGColor
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/线性布局和圆形布局/LineCell.xib:
--------------------------------------------------------------------------------
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 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/线性布局和圆形布局/LineViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LineViewController.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/30.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class LineViewController: UIViewController {
12 |
13 | override func viewDidLoad() {
14 | super.viewDidLoad()
15 |
16 | automaticallyAdjustsScrollViewInsets = false //消除导航栏对view布局的影响
17 |
18 | view.backgroundColor = UIColor.grayColor()
19 | view.addSubview(collectionView)
20 |
21 | collectionView.delegate = self
22 | collectionView.dataSource = self
23 | //注册需要的cell
24 | collectionView.registerNib(UINib(nibName: "LineCell", bundle: NSBundle.mainBundle()), forCellWithReuseIdentifier: "lineCell")
25 | }
26 |
27 |
28 |
29 |
30 | //MARK: - Button 方法
31 |
32 | //切换布局
33 | @IBAction func ChangeLayout() {
34 |
35 | if collectionView.collectionViewLayout.isKindOfClass(LineLayout) {
36 | collectionView.setCollectionViewLayout(CircleLayout(), animated: true)
37 | }else {
38 | let layout = LineLayout()
39 | layout.itemSize = CGSizeMake(150, 150)
40 | collectionView.setCollectionViewLayout(layout, animated: true)
41 |
42 | }
43 | }
44 |
45 | //增加
46 |
47 | @IBAction func AddItem(sender: AnyObject) {
48 | let a = UInt32(dota2Avart.count) < 13 ? UInt32(dota2Avart.count): 13
49 | let picNumber = Int(arc4random_uniform(a))
50 | dota2Avart.insert("dota2-" + "\(picNumber)", atIndex: picNumber)
51 | let index = Int(arc4random_uniform(UInt32(dota2Avart.count)))
52 |
53 | collectionView.insertItemsAtIndexPaths([NSIndexPath(forItem: index, inSection: 0)])
54 |
55 |
56 | }
57 |
58 |
59 |
60 |
61 | //懒加载一个collectionView
62 | lazy var collectionView: UICollectionView = {
63 | //不在使用自带的 collectionViewLayout ,而是自定义的 PubuLayout
64 | let layout = CircleLayout()
65 | let collectionW: CGFloat = self.view.frame.size.width
66 | let collectionH: CGFloat = 300.0
67 | let frame = CGRectMake(0, 150, collectionW, collectionH)
68 | let cv = UICollectionView(frame: frame, collectionViewLayout: layout)
69 | // layout.itemSize = CGSize(width: 100, height: 100)
70 | cv.backgroundColor = UIColor.cyanColor()
71 | cv.showsHorizontalScrollIndicator = false
72 |
73 | return cv
74 |
75 | }()
76 |
77 |
78 |
79 | }
80 |
81 |
82 | //MARK: - 实现data source
83 |
84 | extension LineViewController: UICollectionViewDataSource {
85 |
86 | func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
87 | return 1
88 | }
89 |
90 | func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
91 | return dota2Avart.count
92 | }
93 |
94 | func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
95 | let cell = collectionView.dequeueReusableCellWithReuseIdentifier("lineCell", forIndexPath: indexPath) as! LineCell
96 | cell.lineImageView.image = UIImage(named: dota2Avart[indexPath.item])
97 | return cell
98 | }
99 |
100 |
101 |
102 |
103 | }
104 |
105 | extension LineViewController: UICollectionViewDelegate {
106 |
107 | func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
108 | dota2Avart.removeAtIndex(indexPath.item)
109 | collectionView.deleteItemsAtIndexPaths([indexPath])
110 | }
111 |
112 | }
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/自定义动画/ColorViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ColorViewCell.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/8/29.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ColorViewCell: UICollectionViewCell {
12 |
13 | @IBOutlet weak var numberLabel: UILabel!
14 |
15 | override func awakeFromNib() {
16 | super.awakeFromNib()
17 | // Initialization code
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/自定义动画/ColorViewCell.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/自定义瀑布流布局/MyWaterfallCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MyWaterfallCell.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/9/7.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class MyWaterfallCell: UICollectionViewCell {
12 | @IBOutlet weak var numLabel: UILabel!
13 |
14 | override func awakeFromNib() {
15 | super.awakeFromNib()
16 | // Initialization code
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/自定义瀑布流布局/MyWaterfallCell.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/CollectionViewDemo/CollectionViewDemo/自定义瀑布流布局/WaterfallLayouDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // WaterfallLayouDelegate.swift
3 | // CollectionViewDemo
4 | //
5 | // Created by zhangkuo on 16/9/8.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | //代理 用于接口设置 layout不依赖数据
12 |
13 | @objc protocol WaterfallLayoutDelegate {
14 | func waterfallLayout(waterfallLayout: WaterfallLayout, heightForItemAtIndex index: Int) -> CGFloat
15 | //设置代理来间接设置layout布局中一些属性
16 | optional func columnCountInWaterfallLayout(waterfallLayout: WaterfallLayout) -> Int
17 | optional func columnMarginInWaterfallLayout(waterfallLayout: WaterfallLayout) -> CGFloat
18 | optional func rowMarginInWaterfallLayout(waterfallLayout: WaterfallLayout) -> CGFloat
19 | optional func edgeInsetInWaterfallLayout(waterfallLayout: WaterfallLayout) -> UIEdgeInsets
20 | }
21 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Podfile:
--------------------------------------------------------------------------------
1 | source 'https://github.com/CocoaPods/Specs.git'
2 | platform :ios, "8.0"
3 | use_frameworks!
4 |
5 | target 'CollectionViewDemo' do
6 | pod 'SnapKit', '~> 0.15.0'
7 | pod 'RandomColorSwift'
8 | pod 'MJRefresh'
9 | end
10 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - MJRefresh (3.1.12)
3 | - RandomColorSwift (0.1.0)
4 | - SnapKit (0.15.0)
5 |
6 | DEPENDENCIES:
7 | - MJRefresh
8 | - RandomColorSwift
9 | - SnapKit (~> 0.15.0)
10 |
11 | SPEC CHECKSUMS:
12 | MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806
13 | RandomColorSwift: b2e95d6d3670def6d2f907ec7b7041138b268ac9
14 | SnapKit: 4962eed2ee18e48cbd2b2292fffc57efe7235f87
15 |
16 | PODFILE CHECKSUM: f018a16833cda9ec3da3ed8b3409f2ad79fa070e
17 |
18 | COCOAPODS: 1.0.1
19 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshAutoFooter.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshFooter.h"
10 |
11 | @interface MJRefreshAutoFooter : MJRefreshFooter
12 | /** 是否自动刷新(默认为YES) */
13 | @property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh;
14 |
15 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */
16 | @property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh MJRefreshDeprecated("请使用triggerAutomaticallyRefreshPercent属性");
17 |
18 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */
19 | @property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent;
20 | @end
21 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshBackFooter.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshFooter.h"
10 |
11 | @interface MJRefreshBackFooter : MJRefreshFooter
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Base/MJRefreshComponent.h:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | // MJRefreshComponent.h
4 | // MJRefreshExample
5 | //
6 | // Created by MJ Lee on 15/3/4.
7 | // Copyright (c) 2015年 小码哥. All rights reserved.
8 | // 刷新控件的基类
9 |
10 | #import
11 | #import "MJRefreshConst.h"
12 | #import "UIView+MJExtension.h"
13 | #import "UIScrollView+MJExtension.h"
14 | #import "UIScrollView+MJRefresh.h"
15 | #import "NSBundle+MJRefresh.h"
16 |
17 | /** 刷新控件的状态 */
18 | typedef NS_ENUM(NSInteger, MJRefreshState) {
19 | /** 普通闲置状态 */
20 | MJRefreshStateIdle = 1,
21 | /** 松开就可以进行刷新的状态 */
22 | MJRefreshStatePulling,
23 | /** 正在刷新中的状态 */
24 | MJRefreshStateRefreshing,
25 | /** 即将刷新的状态 */
26 | MJRefreshStateWillRefresh,
27 | /** 所有数据加载完毕,没有更多的数据了 */
28 | MJRefreshStateNoMoreData
29 | };
30 |
31 | /** 进入刷新状态的回调 */
32 | typedef void (^MJRefreshComponentRefreshingBlock)();
33 | /** 开始刷新后的回调(进入刷新状态后的回调) */
34 | typedef void (^MJRefreshComponentbeginRefreshingCompletionBlock)();
35 | /** 结束刷新后的回调 */
36 | typedef void (^MJRefreshComponentEndRefreshingCompletionBlock)();
37 |
38 | /** 刷新控件的基类 */
39 | @interface MJRefreshComponent : UIView
40 | {
41 | /** 记录scrollView刚开始的inset */
42 | UIEdgeInsets _scrollViewOriginalInset;
43 | /** 父控件 */
44 | __weak UIScrollView *_scrollView;
45 | }
46 | #pragma mark - 刷新回调
47 | /** 正在刷新的回调 */
48 | @property (copy, nonatomic) MJRefreshComponentRefreshingBlock refreshingBlock;
49 | /** 设置回调对象和回调方法 */
50 | - (void)setRefreshingTarget:(id)target refreshingAction:(SEL)action;
51 |
52 | /** 回调对象 */
53 | @property (weak, nonatomic) id refreshingTarget;
54 | /** 回调方法 */
55 | @property (assign, nonatomic) SEL refreshingAction;
56 | /** 触发回调(交给子类去调用) */
57 | - (void)executeRefreshingCallback;
58 |
59 | #pragma mark - 刷新状态控制
60 | /** 进入刷新状态 */
61 | - (void)beginRefreshing;
62 | - (void)beginRefreshingWithCompletionBlock:(void (^)())completionBlock;
63 | /** 开始刷新后的回调(进入刷新状态后的回调) */
64 | @property (copy, nonatomic) MJRefreshComponentbeginRefreshingCompletionBlock beginRefreshingCompletionBlock;
65 | /** 结束刷新的回调 */
66 | @property (copy, nonatomic) MJRefreshComponentEndRefreshingCompletionBlock endRefreshingCompletionBlock;
67 | /** 结束刷新状态 */
68 | - (void)endRefreshing;
69 | - (void)endRefreshingWithCompletionBlock:(void (^)())completionBlock;
70 | /** 是否正在刷新 */
71 | - (BOOL)isRefreshing;
72 | /** 刷新状态 一般交给子类内部实现 */
73 | @property (assign, nonatomic) MJRefreshState state;
74 |
75 | #pragma mark - 交给子类去访问
76 | /** 记录scrollView刚开始的inset */
77 | @property (assign, nonatomic, readonly) UIEdgeInsets scrollViewOriginalInset;
78 | /** 父控件 */
79 | @property (weak, nonatomic, readonly) UIScrollView *scrollView;
80 |
81 | #pragma mark - 交给子类们去实现
82 | /** 初始化 */
83 | - (void)prepare NS_REQUIRES_SUPER;
84 | /** 摆放子控件frame */
85 | - (void)placeSubviews NS_REQUIRES_SUPER;
86 | /** 当scrollView的contentOffset发生改变的时候调用 */
87 | - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change NS_REQUIRES_SUPER;
88 | /** 当scrollView的contentSize发生改变的时候调用 */
89 | - (void)scrollViewContentSizeDidChange:(NSDictionary *)change NS_REQUIRES_SUPER;
90 | /** 当scrollView的拖拽状态发生改变的时候调用 */
91 | - (void)scrollViewPanStateDidChange:(NSDictionary *)change NS_REQUIRES_SUPER;
92 |
93 |
94 | #pragma mark - 其他
95 | /** 拉拽的百分比(交给子类重写) */
96 | @property (assign, nonatomic) CGFloat pullingPercent;
97 | /** 根据拖拽比例自动切换透明度 */
98 | @property (assign, nonatomic, getter=isAutoChangeAlpha) BOOL autoChangeAlpha MJRefreshDeprecated("请使用automaticallyChangeAlpha属性");
99 | /** 根据拖拽比例自动切换透明度 */
100 | @property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha;
101 | @end
102 |
103 | @interface UILabel(MJRefresh)
104 | + (instancetype)mj_label;
105 | - (CGFloat)mj_textWith;
106 | @end
107 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Base/MJRefreshFooter.h:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | // MJRefreshFooter.h
4 | // MJRefreshExample
5 | //
6 | // Created by MJ Lee on 15/3/5.
7 | // Copyright (c) 2015年 小码哥. All rights reserved.
8 | // 上拉刷新控件
9 |
10 | #import "MJRefreshComponent.h"
11 |
12 | @interface MJRefreshFooter : MJRefreshComponent
13 | /** 创建footer */
14 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock;
15 | /** 创建footer */
16 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
17 |
18 | /** 提示没有更多的数据 */
19 | - (void)endRefreshingWithNoMoreData;
20 | - (void)noticeNoMoreData MJRefreshDeprecated("使用endRefreshingWithNoMoreData");
21 |
22 | /** 重置没有更多的数据(消除没有更多数据的状态) */
23 | - (void)resetNoMoreData;
24 |
25 | /** 忽略多少scrollView的contentInset的bottom */
26 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom;
27 |
28 | /** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏。默认是NO) */
29 | @property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden;
30 | @end
31 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Base/MJRefreshFooter.m:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | // MJRefreshFooter.m
4 | // MJRefreshExample
5 | //
6 | // Created by MJ Lee on 15/3/5.
7 | // Copyright (c) 2015年 小码哥. All rights reserved.
8 | //
9 |
10 | #import "MJRefreshFooter.h"
11 |
12 | @interface MJRefreshFooter()
13 |
14 | @end
15 |
16 | @implementation MJRefreshFooter
17 | #pragma mark - 构造方法
18 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock
19 | {
20 | MJRefreshFooter *cmp = [[self alloc] init];
21 | cmp.refreshingBlock = refreshingBlock;
22 | return cmp;
23 | }
24 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action
25 | {
26 | MJRefreshFooter *cmp = [[self alloc] init];
27 | [cmp setRefreshingTarget:target refreshingAction:action];
28 | return cmp;
29 | }
30 |
31 | #pragma mark - 重写父类的方法
32 | - (void)prepare
33 | {
34 | [super prepare];
35 |
36 | // 设置自己的高度
37 | self.mj_h = MJRefreshFooterHeight;
38 |
39 | // 默认不会自动隐藏
40 | self.automaticallyHidden = NO;
41 | }
42 |
43 | - (void)willMoveToSuperview:(UIView *)newSuperview
44 | {
45 | [super willMoveToSuperview:newSuperview];
46 |
47 | if (newSuperview) {
48 | // 监听scrollView数据的变化
49 | if ([self.scrollView isKindOfClass:[UITableView class]] || [self.scrollView isKindOfClass:[UICollectionView class]]) {
50 | [self.scrollView setMj_reloadDataBlock:^(NSInteger totalDataCount) {
51 | if (self.isAutomaticallyHidden) {
52 | self.hidden = (totalDataCount == 0);
53 | }
54 | }];
55 | }
56 | }
57 | }
58 |
59 | #pragma mark - 公共方法
60 | - (void)endRefreshingWithNoMoreData
61 | {
62 | self.state = MJRefreshStateNoMoreData;
63 | }
64 |
65 | - (void)noticeNoMoreData
66 | {
67 | [self endRefreshingWithNoMoreData];
68 | }
69 |
70 | - (void)resetNoMoreData
71 | {
72 | self.state = MJRefreshStateIdle;
73 | }
74 | @end
75 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Base/MJRefreshHeader.h:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | // MJRefreshHeader.h
4 | // MJRefreshExample
5 | //
6 | // Created by MJ Lee on 15/3/4.
7 | // Copyright (c) 2015年 小码哥. All rights reserved.
8 | // 下拉刷新控件:负责监控用户下拉的状态
9 |
10 | #import "MJRefreshComponent.h"
11 |
12 | @interface MJRefreshHeader : MJRefreshComponent
13 | /** 创建header */
14 | + (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock;
15 | /** 创建header */
16 | + (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action;
17 |
18 | /** 这个key用来存储上一次下拉刷新成功的时间 */
19 | @property (copy, nonatomic) NSString *lastUpdatedTimeKey;
20 | /** 上一次下拉刷新成功的时间 */
21 | @property (strong, nonatomic, readonly) NSDate *lastUpdatedTime;
22 |
23 | /** 忽略多少scrollView的contentInset的top */
24 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop;
25 | @end
26 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshAutoGifFooter.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshAutoStateFooter.h"
10 |
11 | @interface MJRefreshAutoGifFooter : MJRefreshAutoStateFooter
12 | @property (weak, nonatomic, readonly) UIImageView *gifView;
13 |
14 | /** 设置state状态下的动画图片images 动画持续时间duration*/
15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state;
16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state;
17 | @end
18 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.m:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshAutoGifFooter.m
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshAutoGifFooter.h"
10 |
11 | @interface MJRefreshAutoGifFooter()
12 | {
13 | __unsafe_unretained UIImageView *_gifView;
14 | }
15 | /** 所有状态对应的动画图片 */
16 | @property (strong, nonatomic) NSMutableDictionary *stateImages;
17 | /** 所有状态对应的动画时间 */
18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations;
19 | @end
20 |
21 | @implementation MJRefreshAutoGifFooter
22 | #pragma mark - 懒加载
23 | - (UIImageView *)gifView
24 | {
25 | if (!_gifView) {
26 | UIImageView *gifView = [[UIImageView alloc] init];
27 | [self addSubview:_gifView = gifView];
28 | }
29 | return _gifView;
30 | }
31 |
32 | - (NSMutableDictionary *)stateImages
33 | {
34 | if (!_stateImages) {
35 | self.stateImages = [NSMutableDictionary dictionary];
36 | }
37 | return _stateImages;
38 | }
39 |
40 | - (NSMutableDictionary *)stateDurations
41 | {
42 | if (!_stateDurations) {
43 | self.stateDurations = [NSMutableDictionary dictionary];
44 | }
45 | return _stateDurations;
46 | }
47 |
48 | #pragma mark - 公共方法
49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state
50 | {
51 | if (images == nil) return;
52 |
53 | self.stateImages[@(state)] = images;
54 | self.stateDurations[@(state)] = @(duration);
55 |
56 | /* 根据图片设置控件的高度 */
57 | UIImage *image = [images firstObject];
58 | if (image.size.height > self.mj_h) {
59 | self.mj_h = image.size.height;
60 | }
61 | }
62 |
63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state
64 | {
65 | [self setImages:images duration:images.count * 0.1 forState:state];
66 | }
67 |
68 | #pragma mark - 实现父类的方法
69 | - (void)prepare
70 | {
71 | [super prepare];
72 |
73 | // 初始化间距
74 | self.labelLeftInset = 20;
75 | }
76 |
77 | - (void)placeSubviews
78 | {
79 | [super placeSubviews];
80 |
81 | if (self.gifView.constraints.count) return;
82 |
83 | self.gifView.frame = self.bounds;
84 | if (self.isRefreshingTitleHidden) {
85 | self.gifView.contentMode = UIViewContentModeCenter;
86 | } else {
87 | self.gifView.contentMode = UIViewContentModeRight;
88 | self.gifView.mj_w = self.mj_w * 0.5 - self.labelLeftInset - self.stateLabel.mj_textWith * 0.5;
89 | }
90 | }
91 |
92 | - (void)setState:(MJRefreshState)state
93 | {
94 | MJRefreshCheckState
95 |
96 | // 根据状态做事情
97 | if (state == MJRefreshStateRefreshing) {
98 | NSArray *images = self.stateImages[@(state)];
99 | if (images.count == 0) return;
100 | [self.gifView stopAnimating];
101 |
102 | self.gifView.hidden = NO;
103 | if (images.count == 1) { // 单张图片
104 | self.gifView.image = [images lastObject];
105 | } else { // 多张图片
106 | self.gifView.animationImages = images;
107 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue];
108 | [self.gifView startAnimating];
109 | }
110 | } else if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) {
111 | [self.gifView stopAnimating];
112 | self.gifView.hidden = YES;
113 | }
114 | }
115 | @end
116 |
117 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshAutoNormalFooter.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshAutoStateFooter.h"
10 |
11 | @interface MJRefreshAutoNormalFooter : MJRefreshAutoStateFooter
12 | /** 菊花的样式 */
13 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
14 | @end
15 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.m:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshAutoNormalFooter.m
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshAutoNormalFooter.h"
10 |
11 | @interface MJRefreshAutoNormalFooter()
12 | @property (weak, nonatomic) UIActivityIndicatorView *loadingView;
13 | @end
14 |
15 | @implementation MJRefreshAutoNormalFooter
16 | #pragma mark - 懒加载子控件
17 | - (UIActivityIndicatorView *)loadingView
18 | {
19 | if (!_loadingView) {
20 | UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle];
21 | loadingView.hidesWhenStopped = YES;
22 | [self addSubview:_loadingView = loadingView];
23 | }
24 | return _loadingView;
25 | }
26 |
27 | - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle
28 | {
29 | _activityIndicatorViewStyle = activityIndicatorViewStyle;
30 |
31 | self.loadingView = nil;
32 | [self setNeedsLayout];
33 | }
34 | #pragma mark - 重写父类的方法
35 | - (void)prepare
36 | {
37 | [super prepare];
38 |
39 | self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
40 | }
41 |
42 | - (void)placeSubviews
43 | {
44 | [super placeSubviews];
45 |
46 | if (self.loadingView.constraints.count) return;
47 |
48 | // 圈圈
49 | CGFloat loadingCenterX = self.mj_w * 0.5;
50 | if (!self.isRefreshingTitleHidden) {
51 | loadingCenterX -= self.stateLabel.mj_textWith * 0.5 + self.labelLeftInset;
52 | }
53 | CGFloat loadingCenterY = self.mj_h * 0.5;
54 | self.loadingView.center = CGPointMake(loadingCenterX, loadingCenterY);
55 | }
56 |
57 | - (void)setState:(MJRefreshState)state
58 | {
59 | MJRefreshCheckState
60 |
61 | // 根据状态做事情
62 | if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) {
63 | [self.loadingView stopAnimating];
64 | } else if (state == MJRefreshStateRefreshing) {
65 | [self.loadingView startAnimating];
66 | }
67 | }
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshAutoStateFooter.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/6/13.
6 | // Copyright © 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshAutoFooter.h"
10 |
11 | @interface MJRefreshAutoStateFooter : MJRefreshAutoFooter
12 | /** 文字距离圈圈、箭头的距离 */
13 | @property (assign, nonatomic) CGFloat labelLeftInset;
14 | /** 显示刷新状态的label */
15 | @property (weak, nonatomic, readonly) UILabel *stateLabel;
16 |
17 | /** 设置state状态下的文字 */
18 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state;
19 |
20 | /** 隐藏刷新状态的文字 */
21 | @property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden;
22 | @end
23 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.m:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshAutoStateFooter.m
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/6/13.
6 | // Copyright © 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshAutoStateFooter.h"
10 |
11 | @interface MJRefreshAutoStateFooter()
12 | {
13 | /** 显示刷新状态的label */
14 | __unsafe_unretained UILabel *_stateLabel;
15 | }
16 | /** 所有状态对应的文字 */
17 | @property (strong, nonatomic) NSMutableDictionary *stateTitles;
18 | @end
19 |
20 | @implementation MJRefreshAutoStateFooter
21 | #pragma mark - 懒加载
22 | - (NSMutableDictionary *)stateTitles
23 | {
24 | if (!_stateTitles) {
25 | self.stateTitles = [NSMutableDictionary dictionary];
26 | }
27 | return _stateTitles;
28 | }
29 |
30 | - (UILabel *)stateLabel
31 | {
32 | if (!_stateLabel) {
33 | [self addSubview:_stateLabel = [UILabel mj_label]];
34 | }
35 | return _stateLabel;
36 | }
37 |
38 | #pragma mark - 公共方法
39 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state
40 | {
41 | if (title == nil) return;
42 | self.stateTitles[@(state)] = title;
43 | self.stateLabel.text = self.stateTitles[@(self.state)];
44 | }
45 |
46 | #pragma mark - 私有方法
47 | - (void)stateLabelClick
48 | {
49 | if (self.state == MJRefreshStateIdle) {
50 | [self beginRefreshing];
51 | }
52 | }
53 |
54 | #pragma mark - 重写父类的方法
55 | - (void)prepare
56 | {
57 | [super prepare];
58 |
59 | // 初始化间距
60 | self.labelLeftInset = MJRefreshLabelLeftInset;
61 |
62 | // 初始化文字
63 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterIdleText] forState:MJRefreshStateIdle];
64 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterRefreshingText] forState:MJRefreshStateRefreshing];
65 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterNoMoreDataText] forState:MJRefreshStateNoMoreData];
66 |
67 | // 监听label
68 | self.stateLabel.userInteractionEnabled = YES;
69 | [self.stateLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(stateLabelClick)]];
70 | }
71 |
72 | - (void)placeSubviews
73 | {
74 | [super placeSubviews];
75 |
76 | if (self.stateLabel.constraints.count) return;
77 |
78 | // 状态标签
79 | self.stateLabel.frame = self.bounds;
80 | }
81 |
82 | - (void)setState:(MJRefreshState)state
83 | {
84 | MJRefreshCheckState
85 |
86 | if (self.isRefreshingTitleHidden && state == MJRefreshStateRefreshing) {
87 | self.stateLabel.text = nil;
88 | } else {
89 | self.stateLabel.text = self.stateTitles[@(state)];
90 | }
91 | }
92 | @end
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshBackGifFooter.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshBackStateFooter.h"
10 |
11 | @interface MJRefreshBackGifFooter : MJRefreshBackStateFooter
12 | @property (weak, nonatomic, readonly) UIImageView *gifView;
13 |
14 | /** 设置state状态下的动画图片images 动画持续时间duration*/
15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state;
16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state;
17 | @end
18 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.m:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshBackGifFooter.m
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshBackGifFooter.h"
10 |
11 | @interface MJRefreshBackGifFooter()
12 | {
13 | __unsafe_unretained UIImageView *_gifView;
14 | }
15 | /** 所有状态对应的动画图片 */
16 | @property (strong, nonatomic) NSMutableDictionary *stateImages;
17 | /** 所有状态对应的动画时间 */
18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations;
19 | @end
20 |
21 | @implementation MJRefreshBackGifFooter
22 | #pragma mark - 懒加载
23 | - (UIImageView *)gifView
24 | {
25 | if (!_gifView) {
26 | UIImageView *gifView = [[UIImageView alloc] init];
27 | [self addSubview:_gifView = gifView];
28 | }
29 | return _gifView;
30 | }
31 |
32 | - (NSMutableDictionary *)stateImages
33 | {
34 | if (!_stateImages) {
35 | self.stateImages = [NSMutableDictionary dictionary];
36 | }
37 | return _stateImages;
38 | }
39 |
40 | - (NSMutableDictionary *)stateDurations
41 | {
42 | if (!_stateDurations) {
43 | self.stateDurations = [NSMutableDictionary dictionary];
44 | }
45 | return _stateDurations;
46 | }
47 |
48 | #pragma mark - 公共方法
49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state
50 | {
51 | if (images == nil) return;
52 |
53 | self.stateImages[@(state)] = images;
54 | self.stateDurations[@(state)] = @(duration);
55 |
56 | /* 根据图片设置控件的高度 */
57 | UIImage *image = [images firstObject];
58 | if (image.size.height > self.mj_h) {
59 | self.mj_h = image.size.height;
60 | }
61 | }
62 |
63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state
64 | {
65 | [self setImages:images duration:images.count * 0.1 forState:state];
66 | }
67 |
68 | #pragma mark - 实现父类的方法
69 | - (void)prepare
70 | {
71 | [super prepare];
72 |
73 | // 初始化间距
74 | self.labelLeftInset = 20;
75 | }
76 |
77 | - (void)setPullingPercent:(CGFloat)pullingPercent
78 | {
79 | [super setPullingPercent:pullingPercent];
80 | NSArray *images = self.stateImages[@(MJRefreshStateIdle)];
81 | if (self.state != MJRefreshStateIdle || images.count == 0) return;
82 | [self.gifView stopAnimating];
83 | NSUInteger index = images.count * pullingPercent;
84 | if (index >= images.count) index = images.count - 1;
85 | self.gifView.image = images[index];
86 | }
87 |
88 | - (void)placeSubviews
89 | {
90 | [super placeSubviews];
91 |
92 | if (self.gifView.constraints.count) return;
93 |
94 | self.gifView.frame = self.bounds;
95 | if (self.stateLabel.hidden) {
96 | self.gifView.contentMode = UIViewContentModeCenter;
97 | } else {
98 | self.gifView.contentMode = UIViewContentModeRight;
99 | self.gifView.mj_w = self.mj_w * 0.5 - self.labelLeftInset - self.stateLabel.mj_textWith * 0.5;
100 | }
101 | }
102 |
103 | - (void)setState:(MJRefreshState)state
104 | {
105 | MJRefreshCheckState
106 |
107 | // 根据状态做事情
108 | if (state == MJRefreshStatePulling || state == MJRefreshStateRefreshing) {
109 | NSArray *images = self.stateImages[@(state)];
110 | if (images.count == 0) return;
111 |
112 | self.gifView.hidden = NO;
113 | [self.gifView stopAnimating];
114 | if (images.count == 1) { // 单张图片
115 | self.gifView.image = [images lastObject];
116 | } else { // 多张图片
117 | self.gifView.animationImages = images;
118 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue];
119 | [self.gifView startAnimating];
120 | }
121 | } else if (state == MJRefreshStateIdle) {
122 | self.gifView.hidden = NO;
123 | } else if (state == MJRefreshStateNoMoreData) {
124 | self.gifView.hidden = YES;
125 | }
126 | }
127 | @end
128 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshBackNormalFooter.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshBackStateFooter.h"
10 |
11 | @interface MJRefreshBackNormalFooter : MJRefreshBackStateFooter
12 | @property (weak, nonatomic, readonly) UIImageView *arrowView;
13 | /** 菊花的样式 */
14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
15 | @end
16 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshBackStateFooter.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/6/13.
6 | // Copyright © 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshBackFooter.h"
10 |
11 | @interface MJRefreshBackStateFooter : MJRefreshBackFooter
12 | /** 文字距离圈圈、箭头的距离 */
13 | @property (assign, nonatomic) CGFloat labelLeftInset;
14 | /** 显示刷新状态的label */
15 | @property (weak, nonatomic, readonly) UILabel *stateLabel;
16 | /** 设置state状态下的文字 */
17 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state;
18 |
19 | /** 获取state状态下的title */
20 | - (NSString *)titleForState:(MJRefreshState)state;
21 | @end
22 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.m:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshBackStateFooter.m
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/6/13.
6 | // Copyright © 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshBackStateFooter.h"
10 |
11 | @interface MJRefreshBackStateFooter()
12 | {
13 | /** 显示刷新状态的label */
14 | __unsafe_unretained UILabel *_stateLabel;
15 | }
16 | /** 所有状态对应的文字 */
17 | @property (strong, nonatomic) NSMutableDictionary *stateTitles;
18 | @end
19 |
20 | @implementation MJRefreshBackStateFooter
21 | #pragma mark - 懒加载
22 | - (NSMutableDictionary *)stateTitles
23 | {
24 | if (!_stateTitles) {
25 | self.stateTitles = [NSMutableDictionary dictionary];
26 | }
27 | return _stateTitles;
28 | }
29 |
30 | - (UILabel *)stateLabel
31 | {
32 | if (!_stateLabel) {
33 | [self addSubview:_stateLabel = [UILabel mj_label]];
34 | }
35 | return _stateLabel;
36 | }
37 |
38 | #pragma mark - 公共方法
39 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state
40 | {
41 | if (title == nil) return;
42 | self.stateTitles[@(state)] = title;
43 | self.stateLabel.text = self.stateTitles[@(self.state)];
44 | }
45 |
46 | - (NSString *)titleForState:(MJRefreshState)state {
47 | return self.stateTitles[@(state)];
48 | }
49 |
50 | #pragma mark - 重写父类的方法
51 | - (void)prepare
52 | {
53 | [super prepare];
54 |
55 | // 初始化间距
56 | self.labelLeftInset = MJRefreshLabelLeftInset;
57 |
58 | // 初始化文字
59 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterIdleText] forState:MJRefreshStateIdle];
60 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterPullingText] forState:MJRefreshStatePulling];
61 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterRefreshingText] forState:MJRefreshStateRefreshing];
62 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterNoMoreDataText] forState:MJRefreshStateNoMoreData];
63 | }
64 |
65 | - (void)placeSubviews
66 | {
67 | [super placeSubviews];
68 |
69 | if (self.stateLabel.constraints.count) return;
70 |
71 | // 状态标签
72 | self.stateLabel.frame = self.bounds;
73 | }
74 |
75 | - (void)setState:(MJRefreshState)state
76 | {
77 | MJRefreshCheckState
78 |
79 | // 设置状态文字
80 | self.stateLabel.text = self.stateTitles[@(state)];
81 | }
82 | @end
83 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshGifHeader.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshStateHeader.h"
10 |
11 | @interface MJRefreshGifHeader : MJRefreshStateHeader
12 | @property (weak, nonatomic, readonly) UIImageView *gifView;
13 |
14 | /** 设置state状态下的动画图片images 动画持续时间duration*/
15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state;
16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state;
17 | @end
18 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshNormalHeader.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshStateHeader.h"
10 |
11 | @interface MJRefreshNormalHeader : MJRefreshStateHeader
12 | @property (weak, nonatomic, readonly) UIImageView *arrowView;
13 | /** 菊花的样式 */
14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
15 | @end
16 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // MJRefreshStateHeader.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 15/4/24.
6 | // Copyright (c) 2015年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "MJRefreshHeader.h"
10 |
11 | @interface MJRefreshStateHeader : MJRefreshHeader
12 | #pragma mark - 刷新时间相关
13 | /** 利用这个block来决定显示的更新时间文字 */
14 | @property (copy, nonatomic) NSString *(^lastUpdatedTimeText)(NSDate *lastUpdatedTime);
15 | /** 显示上一次刷新时间的label */
16 | @property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel;
17 |
18 | #pragma mark - 状态相关
19 | /** 文字距离圈圈、箭头的距离 */
20 | @property (assign, nonatomic) CGFloat labelLeftInset;
21 | /** 显示刷新状态的label */
22 | @property (weak, nonatomic, readonly) UILabel *stateLabel;
23 | /** 设置state状态下的文字 */
24 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state;
25 | @end
26 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hant.lproj/Localizable.strings:
--------------------------------------------------------------------------------
1 | "MJRefreshHeaderIdleText" = "下拉可以刷新";
2 | "MJRefreshHeaderPullingText" = "鬆開立即刷新";
3 | "MJRefreshHeaderRefreshingText" = "正在刷新數據中...";
4 |
5 | "MJRefreshAutoFooterIdleText" = "點擊或上拉加載更多";
6 | "MJRefreshAutoFooterRefreshingText" = "正在加載更多的數據...";
7 | "MJRefreshAutoFooterNoMoreDataText" = "已經全部加載完畢";
8 |
9 | "MJRefreshBackFooterIdleText" = "上拉可以加載更多";
10 | "MJRefreshBackFooterPullingText" = "鬆開立即加載更多";
11 | "MJRefreshBackFooterRefreshingText" = "正在加載更多的數據...";
12 | "MJRefreshBackFooterNoMoreDataText" = "已經全部加載完畢";
13 |
14 | "MJRefreshHeaderLastTimeText" = "最後更新:";
15 | "MJRefreshHeaderDateTodayText" = "今天";
16 | "MJRefreshHeaderNoneLastDateText" = "無記錄";
17 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefresh.h:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 |
4 | #import "UIScrollView+MJRefresh.h"
5 | #import "UIScrollView+MJExtension.h"
6 | #import "UIView+MJExtension.h"
7 |
8 | #import "MJRefreshNormalHeader.h"
9 | #import "MJRefreshGifHeader.h"
10 |
11 | #import "MJRefreshBackNormalFooter.h"
12 | #import "MJRefreshBackGifFooter.h"
13 | #import "MJRefreshAutoNormalFooter.h"
14 | #import "MJRefreshAutoGifFooter.h"
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefreshConst.h:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | #import
4 | #import
5 |
6 | // 弱引用
7 | #define MJWeakSelf __weak typeof(self) weakSelf = self;
8 |
9 | // 日志输出
10 | #ifdef DEBUG
11 | #define MJRefreshLog(...) NSLog(__VA_ARGS__)
12 | #else
13 | #define MJRefreshLog(...)
14 | #endif
15 |
16 | // 过期提醒
17 | #define MJRefreshDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead)
18 |
19 | // 运行时objc_msgSend
20 | #define MJRefreshMsgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__)
21 | #define MJRefreshMsgTarget(target) (__bridge void *)(target)
22 |
23 | // RGB颜色
24 | #define MJRefreshColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
25 |
26 | // 文字颜色
27 | #define MJRefreshLabelTextColor MJRefreshColor(90, 90, 90)
28 |
29 | // 字体大小
30 | #define MJRefreshLabelFont [UIFont boldSystemFontOfSize:14]
31 |
32 | // 常量
33 | UIKIT_EXTERN const CGFloat MJRefreshLabelLeftInset;
34 | UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight;
35 | UIKIT_EXTERN const CGFloat MJRefreshFooterHeight;
36 | UIKIT_EXTERN const CGFloat MJRefreshFastAnimationDuration;
37 | UIKIT_EXTERN const CGFloat MJRefreshSlowAnimationDuration;
38 |
39 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentOffset;
40 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentSize;
41 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentInset;
42 | UIKIT_EXTERN NSString *const MJRefreshKeyPathPanState;
43 |
44 | UIKIT_EXTERN NSString *const MJRefreshHeaderLastUpdatedTimeKey;
45 |
46 | UIKIT_EXTERN NSString *const MJRefreshHeaderIdleText;
47 | UIKIT_EXTERN NSString *const MJRefreshHeaderPullingText;
48 | UIKIT_EXTERN NSString *const MJRefreshHeaderRefreshingText;
49 |
50 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterIdleText;
51 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterRefreshingText;
52 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterNoMoreDataText;
53 |
54 | UIKIT_EXTERN NSString *const MJRefreshBackFooterIdleText;
55 | UIKIT_EXTERN NSString *const MJRefreshBackFooterPullingText;
56 | UIKIT_EXTERN NSString *const MJRefreshBackFooterRefreshingText;
57 | UIKIT_EXTERN NSString *const MJRefreshBackFooterNoMoreDataText;
58 |
59 | UIKIT_EXTERN NSString *const MJRefreshHeaderLastTimeText;
60 | UIKIT_EXTERN NSString *const MJRefreshHeaderDateTodayText;
61 | UIKIT_EXTERN NSString *const MJRefreshHeaderNoneLastDateText;
62 |
63 | // 状态检查
64 | #define MJRefreshCheckState \
65 | MJRefreshState oldState = self.state; \
66 | if (state == oldState) return; \
67 | [super setState:state];
68 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/MJRefreshConst.m:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | #import
4 |
5 | const CGFloat MJRefreshLabelLeftInset = 25;
6 | const CGFloat MJRefreshHeaderHeight = 54.0;
7 | const CGFloat MJRefreshFooterHeight = 44.0;
8 | const CGFloat MJRefreshFastAnimationDuration = 0.25;
9 | const CGFloat MJRefreshSlowAnimationDuration = 0.4;
10 |
11 | NSString *const MJRefreshKeyPathContentOffset = @"contentOffset";
12 | NSString *const MJRefreshKeyPathContentInset = @"contentInset";
13 | NSString *const MJRefreshKeyPathContentSize = @"contentSize";
14 | NSString *const MJRefreshKeyPathPanState = @"state";
15 |
16 | NSString *const MJRefreshHeaderLastUpdatedTimeKey = @"MJRefreshHeaderLastUpdatedTimeKey";
17 |
18 | NSString *const MJRefreshHeaderIdleText = @"MJRefreshHeaderIdleText";
19 | NSString *const MJRefreshHeaderPullingText = @"MJRefreshHeaderPullingText";
20 | NSString *const MJRefreshHeaderRefreshingText = @"MJRefreshHeaderRefreshingText";
21 |
22 | NSString *const MJRefreshAutoFooterIdleText = @"MJRefreshAutoFooterIdleText";
23 | NSString *const MJRefreshAutoFooterRefreshingText = @"MJRefreshAutoFooterRefreshingText";
24 | NSString *const MJRefreshAutoFooterNoMoreDataText = @"MJRefreshAutoFooterNoMoreDataText";
25 |
26 | NSString *const MJRefreshBackFooterIdleText = @"MJRefreshBackFooterIdleText";
27 | NSString *const MJRefreshBackFooterPullingText = @"MJRefreshBackFooterPullingText";
28 | NSString *const MJRefreshBackFooterRefreshingText = @"MJRefreshBackFooterRefreshingText";
29 | NSString *const MJRefreshBackFooterNoMoreDataText = @"MJRefreshBackFooterNoMoreDataText";
30 |
31 | NSString *const MJRefreshHeaderLastTimeText = @"MJRefreshHeaderLastTimeText";
32 | NSString *const MJRefreshHeaderDateTodayText = @"MJRefreshHeaderDateTodayText";
33 | NSString *const MJRefreshHeaderNoneLastDateText = @"MJRefreshHeaderNoneLastDateText";
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/NSBundle+MJRefresh.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSBundle+MJRefresh.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 16/6/13.
6 | // Copyright © 2016年 小码哥. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSBundle (MJRefresh)
12 | + (instancetype)mj_refreshBundle;
13 | + (UIImage *)mj_arrowImage;
14 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value;
15 | + (NSString *)mj_localizedStringForKey:(NSString *)key;
16 | @end
17 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/NSBundle+MJRefresh.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSBundle+MJRefresh.m
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 16/6/13.
6 | // Copyright © 2016年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "NSBundle+MJRefresh.h"
10 | #import "MJRefreshComponent.h"
11 |
12 | @implementation NSBundle (MJRefresh)
13 | + (instancetype)mj_refreshBundle
14 | {
15 | static NSBundle *refreshBundle = nil;
16 | if (refreshBundle == nil) {
17 | // 这里不使用mainBundle是为了适配pod 1.x和0.x
18 | refreshBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[MJRefreshComponent class]] pathForResource:@"MJRefresh" ofType:@"bundle"]];
19 | }
20 | return refreshBundle;
21 | }
22 |
23 | + (UIImage *)mj_arrowImage
24 | {
25 | static UIImage *arrowImage = nil;
26 | if (arrowImage == nil) {
27 | arrowImage = [[UIImage imageWithContentsOfFile:[[self mj_refreshBundle] pathForResource:@"arrow@2x" ofType:@"png"]] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
28 | }
29 | return arrowImage;
30 | }
31 |
32 | + (NSString *)mj_localizedStringForKey:(NSString *)key
33 | {
34 | return [self mj_localizedStringForKey:key value:nil];
35 | }
36 |
37 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value
38 | {
39 | static NSBundle *bundle = nil;
40 | if (bundle == nil) {
41 | // (iOS获取的语言字符串比较不稳定)目前框架只处理en、zh-Hans、zh-Hant三种情况,其他按照系统默认处理
42 | NSString *language = [NSLocale preferredLanguages].firstObject;
43 | if ([language hasPrefix:@"en"]) {
44 | language = @"en";
45 | } else if ([language hasPrefix:@"zh"]) {
46 | if ([language rangeOfString:@"Hans"].location != NSNotFound) {
47 | language = @"zh-Hans"; // 简体中文
48 | } else { // zh-Hant\zh-HK\zh-TW
49 | language = @"zh-Hant"; // 繁體中文
50 | }
51 | } else {
52 | language = @"en";
53 | }
54 |
55 | // 从MJRefresh.bundle中查找资源
56 | bundle = [NSBundle bundleWithPath:[[NSBundle mj_refreshBundle] pathForResource:language ofType:@"lproj"]];
57 | }
58 | value = [bundle localizedStringForKey:key value:value table:nil];
59 | return [[NSBundle mainBundle] localizedStringForKey:key value:value table:nil];
60 | }
61 | @end
62 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/UIScrollView+MJExtension.h:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | // UIScrollView+Extension.h
4 | // MJRefreshExample
5 | //
6 | // Created by MJ Lee on 14-5-28.
7 | // Copyright (c) 2014年 小码哥. All rights reserved.
8 | //
9 |
10 | #import
11 |
12 | @interface UIScrollView (MJExtension)
13 | @property (assign, nonatomic) CGFloat mj_insetT;
14 | @property (assign, nonatomic) CGFloat mj_insetB;
15 | @property (assign, nonatomic) CGFloat mj_insetL;
16 | @property (assign, nonatomic) CGFloat mj_insetR;
17 |
18 | @property (assign, nonatomic) CGFloat mj_offsetX;
19 | @property (assign, nonatomic) CGFloat mj_offsetY;
20 |
21 | @property (assign, nonatomic) CGFloat mj_contentW;
22 | @property (assign, nonatomic) CGFloat mj_contentH;
23 | @end
24 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/UIScrollView+MJExtension.m:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | // UIScrollView+Extension.m
4 | // MJRefreshExample
5 | //
6 | // Created by MJ Lee on 14-5-28.
7 | // Copyright (c) 2014年 小码哥. All rights reserved.
8 | //
9 |
10 | #import "UIScrollView+MJExtension.h"
11 | #import
12 |
13 | @implementation UIScrollView (MJExtension)
14 |
15 | - (void)setMj_insetT:(CGFloat)mj_insetT
16 | {
17 | UIEdgeInsets inset = self.contentInset;
18 | inset.top = mj_insetT;
19 | self.contentInset = inset;
20 | }
21 |
22 | - (CGFloat)mj_insetT
23 | {
24 | return self.contentInset.top;
25 | }
26 |
27 | - (void)setMj_insetB:(CGFloat)mj_insetB
28 | {
29 | UIEdgeInsets inset = self.contentInset;
30 | inset.bottom = mj_insetB;
31 | self.contentInset = inset;
32 | }
33 |
34 | - (CGFloat)mj_insetB
35 | {
36 | return self.contentInset.bottom;
37 | }
38 |
39 | - (void)setMj_insetL:(CGFloat)mj_insetL
40 | {
41 | UIEdgeInsets inset = self.contentInset;
42 | inset.left = mj_insetL;
43 | self.contentInset = inset;
44 | }
45 |
46 | - (CGFloat)mj_insetL
47 | {
48 | return self.contentInset.left;
49 | }
50 |
51 | - (void)setMj_insetR:(CGFloat)mj_insetR
52 | {
53 | UIEdgeInsets inset = self.contentInset;
54 | inset.right = mj_insetR;
55 | self.contentInset = inset;
56 | }
57 |
58 | - (CGFloat)mj_insetR
59 | {
60 | return self.contentInset.right;
61 | }
62 |
63 | - (void)setMj_offsetX:(CGFloat)mj_offsetX
64 | {
65 | CGPoint offset = self.contentOffset;
66 | offset.x = mj_offsetX;
67 | self.contentOffset = offset;
68 | }
69 |
70 | - (CGFloat)mj_offsetX
71 | {
72 | return self.contentOffset.x;
73 | }
74 |
75 | - (void)setMj_offsetY:(CGFloat)mj_offsetY
76 | {
77 | CGPoint offset = self.contentOffset;
78 | offset.y = mj_offsetY;
79 | self.contentOffset = offset;
80 | }
81 |
82 | - (CGFloat)mj_offsetY
83 | {
84 | return self.contentOffset.y;
85 | }
86 |
87 | - (void)setMj_contentW:(CGFloat)mj_contentW
88 | {
89 | CGSize size = self.contentSize;
90 | size.width = mj_contentW;
91 | self.contentSize = size;
92 | }
93 |
94 | - (CGFloat)mj_contentW
95 | {
96 | return self.contentSize.width;
97 | }
98 |
99 | - (void)setMj_contentH:(CGFloat)mj_contentH
100 | {
101 | CGSize size = self.contentSize;
102 | size.height = mj_contentH;
103 | self.contentSize = size;
104 | }
105 |
106 | - (CGFloat)mj_contentH
107 | {
108 | return self.contentSize.height;
109 | }
110 | @end
111 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/UIScrollView+MJRefresh.h:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | // UIScrollView+MJRefresh.h
4 | // MJRefreshExample
5 | //
6 | // Created by MJ Lee on 15/3/4.
7 | // Copyright (c) 2015年 小码哥. All rights reserved.
8 | // 给ScrollView增加下拉刷新、上拉刷新的功能
9 |
10 | #import
11 | #import "MJRefreshConst.h"
12 |
13 | @class MJRefreshHeader, MJRefreshFooter;
14 |
15 | @interface UIScrollView (MJRefresh)
16 | /** 下拉刷新控件 */
17 | @property (strong, nonatomic) MJRefreshHeader *mj_header;
18 | @property (strong, nonatomic) MJRefreshHeader *header MJRefreshDeprecated("使用mj_header");
19 | /** 上拉刷新控件 */
20 | @property (strong, nonatomic) MJRefreshFooter *mj_footer;
21 | @property (strong, nonatomic) MJRefreshFooter *footer MJRefreshDeprecated("使用mj_footer");
22 |
23 | #pragma mark - other
24 | - (NSInteger)mj_totalDataCount;
25 | @property (copy, nonatomic) void (^mj_reloadDataBlock)(NSInteger totalDataCount);
26 | @end
27 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/UIView+MJExtension.h:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | // UIView+Extension.h
4 | // MJRefreshExample
5 | //
6 | // Created by MJ Lee on 14-5-28.
7 | // Copyright (c) 2014年 小码哥. All rights reserved.
8 | //
9 |
10 | #import
11 |
12 | @interface UIView (MJExtension)
13 | @property (assign, nonatomic) CGFloat mj_x;
14 | @property (assign, nonatomic) CGFloat mj_y;
15 | @property (assign, nonatomic) CGFloat mj_w;
16 | @property (assign, nonatomic) CGFloat mj_h;
17 | @property (assign, nonatomic) CGSize mj_size;
18 | @property (assign, nonatomic) CGPoint mj_origin;
19 | @end
20 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/MJRefresh/MJRefresh/UIView+MJExtension.m:
--------------------------------------------------------------------------------
1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh
2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
3 | // UIView+Extension.m
4 | // MJRefreshExample
5 | //
6 | // Created by MJ Lee on 14-5-28.
7 | // Copyright (c) 2014年 小码哥. All rights reserved.
8 | //
9 |
10 | #import "UIView+MJExtension.h"
11 |
12 | @implementation UIView (MJExtension)
13 | - (void)setMj_x:(CGFloat)mj_x
14 | {
15 | CGRect frame = self.frame;
16 | frame.origin.x = mj_x;
17 | self.frame = frame;
18 | }
19 |
20 | - (CGFloat)mj_x
21 | {
22 | return self.frame.origin.x;
23 | }
24 |
25 | - (void)setMj_y:(CGFloat)mj_y
26 | {
27 | CGRect frame = self.frame;
28 | frame.origin.y = mj_y;
29 | self.frame = frame;
30 | }
31 |
32 | - (CGFloat)mj_y
33 | {
34 | return self.frame.origin.y;
35 | }
36 |
37 | - (void)setMj_w:(CGFloat)mj_w
38 | {
39 | CGRect frame = self.frame;
40 | frame.size.width = mj_w;
41 | self.frame = frame;
42 | }
43 |
44 | - (CGFloat)mj_w
45 | {
46 | return self.frame.size.width;
47 | }
48 |
49 | - (void)setMj_h:(CGFloat)mj_h
50 | {
51 | CGRect frame = self.frame;
52 | frame.size.height = mj_h;
53 | self.frame = frame;
54 | }
55 |
56 | - (CGFloat)mj_h
57 | {
58 | return self.frame.size.height;
59 | }
60 |
61 | - (void)setMj_size:(CGSize)mj_size
62 | {
63 | CGRect frame = self.frame;
64 | frame.size = mj_size;
65 | self.frame = frame;
66 | }
67 |
68 | - (CGSize)mj_size
69 | {
70 | return self.frame.size;
71 | }
72 |
73 | - (void)setMj_origin:(CGPoint)mj_origin
74 | {
75 | CGRect frame = self.frame;
76 | frame.origin = mj_origin;
77 | self.frame = frame;
78 | }
79 |
80 | - (CGPoint)mj_origin
81 | {
82 | return self.frame.origin;
83 | }
84 | @end
85 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - MJRefresh (3.1.12)
3 | - RandomColorSwift (0.1.0)
4 | - SnapKit (0.15.0)
5 |
6 | DEPENDENCIES:
7 | - MJRefresh
8 | - RandomColorSwift
9 | - SnapKit (~> 0.15.0)
10 |
11 | SPEC CHECKSUMS:
12 | MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806
13 | RandomColorSwift: b2e95d6d3670def6d2f907ec7b7041138b268ac9
14 | SnapKit: 4962eed2ee18e48cbd2b2292fffc57efe7235f87
15 |
16 | PODFILE CHECKSUM: f018a16833cda9ec3da3ed8b3409f2ad79fa070e
17 |
18 | COCOAPODS: 1.0.1
19 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/RandomColorSwift/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Wei Wang (http://onevcat.com)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/RandomColorSwift/README.md:
--------------------------------------------------------------------------------
1 | # Random Color Swift
2 |
3 | Inspired by David Merfield's [randomColor.js](https://github.com/davidmerfield/randomColor). It is a ported version to Swift. You can use the library to generate attractive random colors on iOS or OSX.
4 |
5 | See the [demo and site](http://llllll.li/randomColor/) to know why does this exist.
6 |
7 | [](http://llllll.li/randomColor)
8 |
9 | ## Install
10 |
11 | ### CocoaPods
12 |
13 | The easiest way to use `RandomColor` is installing it by [CocoaPods](http://cocoapods.org). Add these lines to your Podfile:
14 |
15 | ```ruby
16 | source 'https://github.com/CocoaPods/Specs.git'
17 | platform :ios, '8.0'
18 | # platform :osx, '10.10'
19 | use_frameworks!
20 |
21 | pod 'RandomColorSwift'
22 | ```
23 |
24 | ### Carthage
25 |
26 | [Carthage](https://github.com/Carthage/Carthage) is also supported:
27 |
28 | ```ogdl
29 | github "onevcat/RandomColorSwift"
30 | ```
31 |
32 | ### Manually
33 |
34 | If you need to support iOS 7.x, you will need to add the library manually into your project since dynamic framework is not supported for iOS 7.
35 |
36 | Clone this repo and throw the source files under `RandomColor` folder into your project to use it.
37 |
38 | ## Example
39 |
40 | ```swift
41 | import RandomColorSwift
42 |
43 | // Returns a UIColor or NSColor object for an attractive color
44 | let color = randomColor()
45 |
46 | // Returns an array of ten green colors
47 | let greenColors = randomColorsCount(10, hue: .Green)
48 |
49 | // Returns a color for light blue
50 | let lightBlurColor = randomColor(hue: .Blue, luminosity: .Light)
51 |
52 | // Returns a color for a 'truly random' color
53 | let randomColor = randomColor(hue: .Random, luminosity: .Random)
54 |
55 | // Returns an array of ten dark pink colors
56 | let darkPinkColors = randomColorsCount(10, hue: .Pink, luminosity: .Dark)
57 |
58 | // Returns an array of twenty colors at hue of 120
59 | let colors = randomColorsCount(20, hue: .Value(120), luminosity: .Random)
60 |
61 | ```
62 |
63 | There is also a demo project in this repo.
64 |
65 | ## Options
66 |
67 | You can pass an options object to influence the type of color it produces. The options object accepts the following properties:
68 |
69 | **Hue** – Controls the hue of the generated color. Possible hue values for colors are `.Monochrome`, `.Red`, `.Orange`, `.Yellow`, `.Green`, `.Blue`, `.Purple`, `.Pink`, `.Random` or `.Value(Int)`. If you use `.Value(Int)`, you should pass an `Int` between 0 and 360.
70 |
71 | **Luminosity** – Controls the luminosity of the generated color. You can pass `.Bright`, `.Light`, `.Dark` or `.Random`.
72 |
73 | **Count** – An `Int` which specifies the number of colors to generate.
74 |
75 | ## Acknowledgements
76 |
77 | Thanks for David Merfield bringing us randomColor.js, which is a great utility.
78 |
79 | The demo project is using Chirag Mehta's [Name the Color](http://chir.ag/projects/name-that-color) JavaScript library to extract name of color.
80 |
81 | ## License
82 |
83 | This project is licensed under the terms of the MIT license.
84 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/RandomColorSwift/RandomColor/ColorDefinition.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ColorDefinition.swift
3 | // RandomColorSwift
4 | //
5 | // Copyright (c) 2015 Wei Wang (http://onevcat.com)
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to deal
9 | // in the Software without restriction, including without limitation the rights
10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | // copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 |
25 | import Foundation
26 |
27 | typealias Range = (min: Int, max: Int)
28 |
29 | struct ColorDefinition {
30 | let hueRange: Range?
31 | let lowerBounds: [Range]
32 |
33 | lazy var saturationRange: Range = {
34 | let sMin = self.lowerBounds[0].0
35 | let sMax = self.lowerBounds[self.lowerBounds.count - 1].0
36 | return (sMin, sMax)
37 | }()
38 |
39 | lazy var brightnessRange: Range = {
40 | let bMin = self.lowerBounds[self.lowerBounds.count - 1].1
41 | let bMax = self.lowerBounds[0].1
42 | return (bMin, bMax)
43 | }()
44 |
45 | init(hueRange: Range?, lowerBounds: [Range]) {
46 | self.hueRange = hueRange
47 | self.lowerBounds = lowerBounds
48 | }
49 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/RandomColorSwift/RandomColor/Hue.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Hue.swift
3 | // RandomColorSwift
4 | //
5 | // Copyright (c) 2015 Wei Wang (http://onevcat.com)
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to deal
9 | // in the Software without restriction, including without limitation the rights
10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | // copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 |
25 | import Foundation
26 |
27 | public enum Hue {
28 |
29 | case Monochrome, Red, Orange, Yellow, Green, Blue, Purple, Pink
30 | case Value(Int)
31 | case Random
32 |
33 | public func toInt() -> Int {
34 | switch self {
35 | case .Monochrome: return 1
36 | case .Red: return 2
37 | case .Orange: return 3
38 | case .Yellow: return 4
39 | case .Green: return 5
40 | case .Blue: return 6
41 | case .Purple: return 7
42 | case .Pink: return 8
43 | case .Value(_): return -1
44 | case .Random: return 0
45 | }
46 | }
47 | }
48 |
49 | public func == (lhs: Hue, rhs: Hue) -> Bool {
50 | return lhs.toInt() == rhs.toInt()
51 | }
52 |
53 | extension Hue: Hashable {
54 | public var hashValue: Int {
55 | get {
56 | return self.toInt()
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/RandomColorSwift/RandomColor/Luminosity.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Luminosity.swift
3 | // RandomColorSwift
4 | //
5 | // Copyright (c) 2015 Wei Wang (http://onevcat.com)
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to deal
9 | // in the Software without restriction, including without limitation the rights
10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | // copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 |
25 | import Foundation
26 |
27 | public enum Luminosity: Int {
28 | case Bright, Light, Dark
29 | case Random
30 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/SnapKit/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/SnapKit/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.
4 |
5 | [](https://travis-ci.org/SnapKit/SnapKit)
6 | [](https://img.shields.io/cocoapods/v/SnapKit.svg)
7 | [](https://github.com/Carthage/Carthage)
8 |
9 | ```swift
10 | import SnapKit
11 |
12 | class MyViewController: UIViewController {
13 |
14 | lazy var box = UIView()
15 |
16 | override func viewDidLoad() {
17 | super.viewDidLoad()
18 |
19 | self.view.addSubview(box)
20 | box.snp_makeConstraints { (make) -> Void in
21 | make.width.height.equalTo(50)
22 | make.center.equalTo(self.view)
23 | }
24 | }
25 |
26 | }
27 | ```
28 |
29 | ## Resources
30 |
31 | * [Documentation](http://snapkit.io/docs/)
32 | * [F.A.Q.](http://snapkit.io/faq/)
33 | * [Legacy Platforms (iOS 7.0, OS X 10.9)](http://snapkit.io/legacy-platforms/)
34 |
35 | ## License
36 |
37 | MIT license. See the `LICENSE` file for details.
38 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/SnapKit/Source/ConstraintItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 | /**
31 | Used to assist in building a constraint
32 | */
33 | public class ConstraintItem {
34 |
35 | internal init(object: AnyObject?, attributes: ConstraintAttributes) {
36 | self.object = object
37 | self.attributes = attributes
38 | }
39 |
40 | internal weak var object: AnyObject?
41 | internal var attributes: ConstraintAttributes
42 |
43 | internal var view: View? {
44 | return self.object as? View
45 | }
46 |
47 | @available(iOS 7.0, *)
48 | internal var layoutSupport: LayoutSupport? {
49 | return self.object as? LayoutSupport
50 | }
51 | }
52 |
53 |
54 | internal func ==(left: ConstraintItem, right: ConstraintItem) -> Bool {
55 | if left.object == nil {
56 | return false
57 | }
58 | if right.object == nil {
59 | return false
60 | }
61 | if left.object !== right.object {
62 | return false
63 | }
64 | if left.attributes != right.attributes {
65 | return false
66 | }
67 | return true
68 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/SnapKit/Source/ConstraintRelation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 | /**
31 | Used to define `NSLayoutRelation`
32 | */
33 | internal enum ConstraintRelation: Int {
34 | case Equal = 1, LessThanOrEqualTo, GreaterThanOrEqualTo
35 |
36 | internal var layoutRelation: NSLayoutRelation {
37 | get {
38 | switch(self) {
39 | case .LessThanOrEqualTo:
40 | return .LessThanOrEqual
41 | case .GreaterThanOrEqualTo:
42 | return .GreaterThanOrEqual
43 | default:
44 | return .Equal
45 | }
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/SnapKit/Source/EdgeInsets.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS)
25 | import UIKit
26 | public typealias EdgeInsets = UIEdgeInsets
27 | public func EdgeInsetsMake(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> EdgeInsets {
28 | return EdgeInsets(top: top, left: left, bottom: bottom, right: right)
29 | }
30 | public let EdgeInsetsZero = EdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
31 | #else
32 | import AppKit
33 | public typealias EdgeInsets = NSEdgeInsets
34 | public func EdgeInsetsMake(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> EdgeInsets {
35 | return EdgeInsets(top: top, left: left, bottom: bottom, right: right)
36 | }
37 | public let EdgeInsetsZero = EdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
38 | #endif
39 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/SnapKit/Source/LayoutConstraint.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 | /**
31 | Used to add extra information to the actual `NSLayoutConstraint`'s that will UIKit/AppKit will utilize
32 | */
33 | public class LayoutConstraint: NSLayoutConstraint {
34 |
35 | internal var snp_constraint: Constraint? = nil
36 |
37 | }
38 |
39 | internal func ==(left: LayoutConstraint, right: LayoutConstraint) -> Bool {
40 | if left.firstItem !== right.firstItem {
41 | return false
42 | }
43 | if left.secondItem !== right.secondItem {
44 | return false
45 | }
46 | if left.firstAttribute != right.firstAttribute {
47 | return false
48 | }
49 | if left.secondAttribute != right.secondAttribute {
50 | return false
51 | }
52 | if left.relation != right.relation {
53 | return false
54 | }
55 | if left.priority != right.priority {
56 | return false
57 | }
58 | if left.multiplier != right.multiplier {
59 | return false
60 | }
61 | return true
62 | }
63 |
64 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/SnapKit/Source/SnapKit.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS)
25 | import UIKit
26 | public typealias InterfaceLayoutDirection = UIUserInterfaceLayoutDirection
27 | public typealias LayoutSupport = UILayoutSupport
28 | #else
29 | import AppKit
30 | public typealias InterfaceLayoutDirection = NSUserInterfaceLayoutDirection
31 | public class LayoutSupport {}
32 | #endif
33 |
34 | /**
35 | Used to configure different parts of SnapKit
36 | */
37 | public struct Config {
38 |
39 | /// The interface layout direction
40 | public static var interfaceLayoutDirection = InterfaceLayoutDirection.LeftToRight
41 |
42 | }
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/SnapKit/Source/ViewController+SnapKit.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS)
25 | import UIKit
26 |
27 | /**
28 | Used to expose public API on view controllers
29 | */
30 | public extension UIViewController {
31 |
32 | /// top layout guide top
33 | public var snp_topLayoutGuideTop: ConstraintItem { return ConstraintItem(object: self.topLayoutGuide, attributes: ConstraintAttributes.Top) }
34 |
35 | /// top layout guide bottom
36 | public var snp_topLayoutGuideBottom: ConstraintItem { return ConstraintItem(object: self.topLayoutGuide, attributes: ConstraintAttributes.Bottom) }
37 |
38 | /// bottom layout guide top
39 | public var snp_bottomLayoutGuideTop: ConstraintItem { return ConstraintItem(object: self.bottomLayoutGuide, attributes: ConstraintAttributes.Top) }
40 |
41 | /// bottom layout guide bottom
42 | public var snp_bottomLayoutGuideBottom: ConstraintItem { return ConstraintItem(object: self.bottomLayoutGuide, attributes: ConstraintAttributes.Bottom) }
43 |
44 | }
45 | #endif
46 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/MJRefresh/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 | FMWK
17 | CFBundleShortVersionString
18 | 3.1.12
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/MJRefresh/MJRefresh-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_MJRefresh : NSObject
3 | @end
4 | @implementation PodsDummy_MJRefresh
5 | @end
6 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/MJRefresh/MJRefresh-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/MJRefresh/MJRefresh-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "MJRefreshAutoFooter.h"
4 | #import "MJRefreshBackFooter.h"
5 | #import "MJRefreshComponent.h"
6 | #import "MJRefreshFooter.h"
7 | #import "MJRefreshHeader.h"
8 | #import "MJRefreshAutoGifFooter.h"
9 | #import "MJRefreshAutoNormalFooter.h"
10 | #import "MJRefreshAutoStateFooter.h"
11 | #import "MJRefreshBackGifFooter.h"
12 | #import "MJRefreshBackNormalFooter.h"
13 | #import "MJRefreshBackStateFooter.h"
14 | #import "MJRefreshGifHeader.h"
15 | #import "MJRefreshNormalHeader.h"
16 | #import "MJRefreshStateHeader.h"
17 | #import "MJRefresh.h"
18 | #import "MJRefreshConst.h"
19 | #import "NSBundle+MJRefresh.h"
20 | #import "UIScrollView+MJExtension.h"
21 | #import "UIScrollView+MJRefresh.h"
22 | #import "UIView+MJExtension.h"
23 |
24 | FOUNDATION_EXPORT double MJRefreshVersionNumber;
25 | FOUNDATION_EXPORT const unsigned char MJRefreshVersionString[];
26 |
27 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/MJRefresh/MJRefresh.modulemap:
--------------------------------------------------------------------------------
1 | framework module MJRefresh {
2 | umbrella header "MJRefresh-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/MJRefresh/MJRefresh.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MJRefresh
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
4 | PODS_BUILD_DIR = $BUILD_DIR
5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
8 | SKIP_INSTALL = YES
9 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/Pods-CollectionViewDemo/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 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/Pods-CollectionViewDemo/Pods-CollectionViewDemo-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## MJRefresh
5 |
6 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh)
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 |
26 |
27 | ## RandomColorSwift
28 |
29 | Copyright (c) 2015 Wei Wang (http://onevcat.com)
30 |
31 | Permission is hereby granted, free of charge, to any person obtaining a copy
32 | of this software and associated documentation files (the "Software"), to deal
33 | in the Software without restriction, including without limitation the rights
34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35 | copies of the Software, and to permit persons to whom the Software is
36 | furnished to do so, subject to the following conditions:
37 |
38 | The above copyright notice and this permission notice shall be included in all
39 | copies or substantial portions of the Software.
40 |
41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47 | SOFTWARE.
48 |
49 | ## SnapKit
50 |
51 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
52 |
53 | Permission is hereby granted, free of charge, to any person obtaining a copy
54 | of this software and associated documentation files (the "Software"), to deal
55 | in the Software without restriction, including without limitation the rights
56 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57 | copies of the Software, and to permit persons to whom the Software is
58 | furnished to do so, subject to the following conditions:
59 |
60 | The above copyright notice and this permission notice shall be included in
61 | all copies or substantial portions of the Software.
62 |
63 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
69 | THE SOFTWARE.
70 |
71 | Generated by CocoaPods - https://cocoapods.org
72 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/Pods-CollectionViewDemo/Pods-CollectionViewDemo-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_CollectionViewDemo : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_CollectionViewDemo
5 | @end
6 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/Pods-CollectionViewDemo/Pods-CollectionViewDemo-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double Pods_CollectionViewDemoVersionNumber;
5 | FOUNDATION_EXPORT const unsigned char Pods_CollectionViewDemoVersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/Pods-CollectionViewDemo/Pods-CollectionViewDemo.debug.xcconfig:
--------------------------------------------------------------------------------
1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh" "$PODS_CONFIGURATION_BUILD_DIR/RandomColorSwift" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh/MJRefresh.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RandomColorSwift/RandomColorSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "MJRefresh" -framework "RandomColorSwift" -framework "SnapKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = $BUILD_DIR
9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_ROOT = ${SRCROOT}/Pods
11 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/Pods-CollectionViewDemo/Pods-CollectionViewDemo.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_CollectionViewDemo {
2 | umbrella header "Pods-CollectionViewDemo-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/Pods-CollectionViewDemo/Pods-CollectionViewDemo.release.xcconfig:
--------------------------------------------------------------------------------
1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh" "$PODS_CONFIGURATION_BUILD_DIR/RandomColorSwift" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh/MJRefresh.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RandomColorSwift/RandomColorSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "MJRefresh" -framework "RandomColorSwift" -framework "SnapKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = $BUILD_DIR
9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_ROOT = ${SRCROOT}/Pods
11 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/RandomColorSwift/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 | FMWK
17 | CFBundleShortVersionString
18 | 0.1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/RandomColorSwift/RandomColorSwift-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_RandomColorSwift : NSObject
3 | @end
4 | @implementation PodsDummy_RandomColorSwift
5 | @end
6 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/RandomColorSwift/RandomColorSwift-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/RandomColorSwift/RandomColorSwift-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double RandomColorSwiftVersionNumber;
5 | FOUNDATION_EXPORT const unsigned char RandomColorSwiftVersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/RandomColorSwift/RandomColorSwift.modulemap:
--------------------------------------------------------------------------------
1 | framework module RandomColorSwift {
2 | umbrella header "RandomColorSwift-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/RandomColorSwift/RandomColorSwift.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/RandomColorSwift
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/SnapKit/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 | FMWK
17 | CFBundleShortVersionString
18 | 0.15.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/SnapKit/SnapKit-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SnapKit : NSObject
3 | @end
4 | @implementation PodsDummy_SnapKit
5 | @end
6 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/SnapKit/SnapKit-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/SnapKit/SnapKit-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double SnapKitVersionNumber;
5 | FOUNDATION_EXPORT const unsigned char SnapKitVersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/SnapKit/SnapKit.modulemap:
--------------------------------------------------------------------------------
1 | framework module SnapKit {
2 | umbrella header "SnapKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/CollectionViewDemo/Pods/Target Support Files/SnapKit/SnapKit.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SnapKit
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/事件传递及响应Demo/.DS_Store
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/事件传递及响应Demo/事件传递及响应Demo/.DS_Store
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18 |
19 | // Demo1
20 | /*
21 | window = MyUIwindow(frame: UIScreen.mainScreen().bounds)
22 | let sb = UIStoryboard(name: "Main", bundle: nil)
23 | let vc = sb.instantiateInitialViewController()
24 |
25 | //设置窗口
26 | window?.rootViewController = vc
27 | window?.makeKeyAndVisible()
28 | return true
29 | */
30 | //
31 | // Demo2
32 | window = UIWindow(frame: UIScreen.mainScreen().bounds)
33 | let sb = UIStoryboard(name: "Main", bundle: nil)
34 | let vc = sb.instantiateViewControllerWithIdentifier("Demo2")
35 | print(vc)
36 | window?.rootViewController = vc
37 | window?.makeKeyAndVisible()
38 |
39 |
40 |
41 | return true
42 | }
43 |
44 | func applicationWillResignActive(application: UIApplication) {
45 | // 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.
46 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
47 | }
48 |
49 | func applicationDidEnterBackground(application: UIApplication) {
50 | // 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.
51 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
52 | }
53 |
54 | func applicationWillEnterForeground(application: UIApplication) {
55 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
56 | }
57 |
58 | func applicationDidBecomeActive(application: UIApplication) {
59 | // 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.
60 | }
61 |
62 | func applicationWillTerminate(application: UIApplication) {
63 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
64 | }
65 |
66 |
67 | }
68 |
69 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/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 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/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 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController {
12 |
13 | override func viewDidLoad() {
14 | super.viewDidLoad()
15 | // Do any additional setup after loading the view, typically from a nib.
16 | }
17 |
18 | override func didReceiveMemoryWarning() {
19 | super.didReceiveMemoryWarning()
20 | // Dispose of any resources that can be recreated.
21 | }
22 |
23 |
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo1/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/事件传递及响应Demo/事件传递及响应Demo/demo1/.DS_Store
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo1/BaseView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseView.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class BaseView: UIView {
12 |
13 | override func touchesBegan(touches: Set, withEvent event: UIEvent?) {
14 | print("\(self.classForCoder)------touchesBegan")
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo1/BlueView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BlueView.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class BlueView: BaseView {
12 |
13 | /*
14 | // Only override drawRect: if you perform custom drawing.
15 | // An empty implementation adversely affects performance during animation.
16 | override func drawRect(rect: CGRect) {
17 | // Drawing code
18 | }
19 | */
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo1/GreenView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GreenView.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class GreenView: BaseView {
12 |
13 | /*
14 | // Only override drawRect: if you perform custom drawing.
15 | // An empty implementation adversely affects performance during animation.
16 | override func drawRect(rect: CGRect) {
17 | // Drawing code
18 | }
19 | */
20 |
21 | // override func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? {
22 | // return self
23 | // }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo1/MyUIwindow.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MyUIwindow.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class MyUIwindow: UIWindow {
12 |
13 |
14 | /**
15 | 事件传递的时候调用,当事件传递给控件的时候,就会调用控件的这个方法去寻找最合适的 View
16 | */
17 | //作用:寻找最合适的View
18 |
19 | //point:当前的触摸点,point点的坐标系就是方法调用者,谁调用hitTest方法,坐标系就是谁。
20 |
21 | override func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? {
22 |
23 | print(#function)
24 | let fitView: UIView = super.hitTest(point, withEvent: event)!
25 | // print(fitView)
26 | //调用系统的做法去寻找最合适的View
27 | return fitView
28 |
29 | //return subviews[0].subviews[0]
30 | // return nil //都不处理
31 | }
32 |
33 | /**
34 | 作用: 判断当前这个点在不在方法调用者(控件上)
35 | */
36 | override func pointInside(point: CGPoint, withEvent event: UIEvent?) -> Bool {
37 | return true
38 | }
39 |
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo1/OrangeView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // OrangeView.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class OrangeView: BaseView {
12 |
13 | /*
14 | // Only override drawRect: if you perform custom drawing.
15 | // An empty implementation adversely affects performance during animation.
16 | override func drawRect(rect: CGRect) {
17 | // Drawing code
18 | }
19 | */
20 | // override func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? {
21 | // return self
22 | // }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo1/RedView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RedView.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class RedView: BaseView {
12 |
13 | /*
14 | // Only override drawRect: if you perform custom drawing.
15 | // An empty implementation adversely affects performance during animation.
16 | override func drawRect(rect: CGRect) {
17 | // Drawing code
18 | }
19 | */
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo1/WhiteView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // WhiteView.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class WhiteView: BaseView {
12 |
13 | /*
14 | // Only override drawRect: if you perform custom drawing.
15 | // An empty implementation adversely affects performance during animation.
16 | override func drawRect(rect: CGRect) {
17 | // Drawing code
18 | }
19 | */
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo1/YellowView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // YellowView.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class YellowView: BaseView {
12 |
13 | /*
14 | // Only override drawRect: if you perform custom drawing.
15 | // An empty implementation adversely affects performance during animation.
16 | override func drawRect(rect: CGRect) {
17 | // Drawing code
18 | }
19 | */
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo2/Demo2ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Demo2ViewController.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class Demo2ViewController: UIViewController {
12 |
13 |
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 | print(view)
17 |
18 | // Do any additional setup after loading the view.
19 | }
20 |
21 | override func didReceiveMemoryWarning() {
22 | super.didReceiveMemoryWarning()
23 | // Dispose of any resources that can be recreated.
24 | }
25 |
26 |
27 | /*
28 | // MARK: - Navigation
29 |
30 | // In a storyboard-based application, you will often want to do a little preparation before navigation
31 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
32 | // Get the new view controller using segue.destinationViewController.
33 | // Pass the selected object to the new view controller.
34 | }
35 | */
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/事件传递及响应Demo/事件传递及响应Demo/demo2/Yellow2View.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Yellow2View.swift
3 | // 事件传递及响应Demo
4 | //
5 | // Created by zhangkuo on 16/9/12.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class Yellow2View: UIView {
12 | @IBOutlet weak var button: UIButton!
13 | override func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? {
14 |
15 | //当前坐标系的点转到按钮上的点
16 | let btnP = convertPoint(point, toView: button)
17 |
18 | //判断点在不在按钮上 注意坐标系采用的是方法调用者的坐标系
19 | if button.pointInside(btnP, withEvent: event) {
20 | //点在按钮上
21 | return button
22 | }else {
23 | return super.hitTest(point, withEvent: event)
24 | }
25 |
26 | }
27 |
28 | override func touchesBegan(touches: Set, withEvent event: UIEvent?) {
29 | print(self)
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/Animation01ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Animation01ViewController.swift
3 | // 动画学习Demo
4 | //
5 | // Created by zhangkuo on 16/9/18.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class Animation01ViewController: UIViewController {
12 |
13 | @IBOutlet weak var testView: UIView!
14 | @IBOutlet weak var testView2: UIView!
15 | @IBOutlet weak var image: UIImageView!
16 | override func viewDidLoad() {
17 | super.viewDidLoad()
18 |
19 | // Do any additional setup after loading the view.
20 | }
21 |
22 | override func didReceiveMemoryWarning() {
23 | super.didReceiveMemoryWarning()
24 | // Dispose of any resources that can be recreated.
25 | }
26 | @IBAction func startAnimation(sender: AnyObject) {
27 |
28 | //开始动画
29 | changeFrame()
30 |
31 |
32 | }
33 |
34 | @IBAction func transBtn(sender: AnyObject) {
35 | flipAni()
36 |
37 | }
38 |
39 | private func changeFrame() {
40 | UIView.beginAnimations("frameAni", context: nil)
41 | UIView.setAnimationDelay(0.0)
42 | UIView.setAnimationDuration(1)
43 | UIView.setAnimationDelegate(self)
44 | UIView.setAnimationWillStartSelector(#selector(Animation01ViewController.startAni))
45 | UIView.setAnimationDidStopSelector(#selector(Animation01ViewController.stopAni))
46 | UIView.setAnimationCurve(UIViewAnimationCurve.EaseInOut)
47 | UIView.setAnimationRepeatCount(1)
48 | // UIView.setAnimationRepeatAutoreverses(true)//是否以动画的效果恢复原来
49 | testView.frame = CGRect(x: 100, y: 100, width: 200, height: 100)
50 | testView.backgroundColor = UIColor.redColor()
51 | UIView.commitAnimations()
52 | }
53 | func startAni() {
54 | print("startAni")
55 |
56 | }
57 | func stopAni() {
58 | print("stopAni")
59 | }
60 |
61 | private func flipAni() {
62 | UIView.beginAnimations("FlipAni", context: nil)
63 | UIView.setAnimationDuration(1.0)
64 | UIView.setAnimationRepeatCount(1)
65 | UIView.setAnimationCurve(UIViewAnimationCurve.EaseInOut)
66 | UIView.setAnimationTransition(UIViewAnimationTransition.FlipFromLeft, forView: testView2, cache: true)
67 | image.image = UIImage(named: "dota2-0")
68 | UIView.commitAnimations()
69 | }
70 |
71 |
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/Animation02ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Animation02ViewController.swift
3 | // 动画学习Demo
4 | //
5 | // Created by zhangkuo on 16/9/18.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class Animation02ViewController: UIViewController {
12 |
13 | @IBOutlet weak var greenView: UIView!
14 |
15 | let fram1 = CGRect(x: 100, y: 100, width: 100, height: 100)
16 | override func viewDidLoad() {
17 | super.viewDidLoad()
18 |
19 | // Do any additional setup after loading the view.
20 | }
21 |
22 | override func didReceiveMemoryWarning() {
23 | super.didReceiveMemoryWarning()
24 | // Dispose of any resources that can be recreated.
25 | }
26 |
27 |
28 | private func blockAni1() {
29 | UIView.animateWithDuration(2.0) {
30 | self.greenView.frame = self.fram1
31 | self.greenView.backgroundColor = UIColor.redColor()
32 | }
33 | }
34 |
35 | private func blockAni2() {
36 |
37 | UIView.animateWithDuration(2.0, animations: {
38 | self.greenView.frame = CGRect(x: 150, y: 150, width: 150, height: 150)
39 | self.greenView.backgroundColor = UIColor.blueColor()
40 | }) { (_) in
41 | print("动画完成blockAni2()")
42 | }
43 | }
44 |
45 | private func blockAni3() {
46 | UIView.animateWithDuration(1.0, delay: 1.0, options: [UIViewAnimationOptions.CurveEaseInOut], animations: {
47 | self.greenView.frame = CGRect(x: 150, y: 290, width: 190, height: 150)
48 | self.greenView.backgroundColor = UIColor.yellowColor()
49 | }) { (_) in
50 | print("动画完成blockAni3()")
51 | }
52 | }
53 |
54 | private func blockAni4() {
55 | UIView.animateWithDuration(2, delay: 1, usingSpringWithDamping: 0.2, initialSpringVelocity: 2, options: UIViewAnimationOptions.CurveEaseInOut, animations: {
56 | self.greenView.frame = CGRect(x: 200, y: 290, width: 200, height: 200)
57 | self.greenView.backgroundColor = UIColor.cyanColor()
58 | }) { (_) in
59 | print("动画完成blockAni4()")
60 | }
61 | }
62 |
63 | private func blockAni5() {
64 | UIView.animateKeyframesWithDuration(5, delay: 0.0, options: UIViewKeyframeAnimationOptions.CalculationModeLinear, animations: {
65 | UIView.addKeyframeWithRelativeStartTime(0, relativeDuration: 1.0/4, animations: {
66 | self.greenView.backgroundColor = UIColor.redColor()
67 | })
68 |
69 | UIView.addKeyframeWithRelativeStartTime(1.0/4, relativeDuration: 1.0/4, animations: {
70 | self.greenView.backgroundColor = UIColor.blackColor()
71 | self.greenView.frame.size = CGSize(width: 50, height: 50)
72 | })
73 |
74 | UIView.addKeyframeWithRelativeStartTime(2.0/4, relativeDuration: 1.0/4, animations: {
75 | self.greenView.backgroundColor = UIColor.yellowColor()
76 | })
77 | UIView.addKeyframeWithRelativeStartTime(3.0/4, relativeDuration: 1.0/4, animations: {
78 | self.greenView.backgroundColor = UIColor.blueColor()
79 | self.greenView.frame.size = CGSize(width: 250, height: 250)
80 | })
81 |
82 |
83 |
84 | }) { (_) in
85 | print("动画完成blockAni5()")
86 | }
87 | }
88 |
89 |
90 |
91 | @IBAction func start1(sender: AnyObject) {
92 | blockAni1()
93 |
94 | }
95 |
96 | @IBAction func start2(sender: AnyObject) {
97 | blockAni2()
98 | }
99 |
100 | @IBAction func start3(sender: AnyObject) {
101 | blockAni3()
102 | }
103 |
104 | @IBAction func start4(sender: AnyObject) {
105 | blockAni4()
106 | }
107 |
108 | @IBAction func start5(sender: AnyObject) {
109 | blockAni5()
110 | }
111 |
112 |
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/Animation03ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Animation03ViewController.swift
3 | // 动画学习Demo
4 | //
5 | // Created by zhangkuo on 16/9/18.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class Animation03ViewController: UIViewController {
12 |
13 | @IBOutlet weak var view1: UIView!
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | // Do any additional setup after loading the view.
18 | }
19 |
20 | override func didReceiveMemoryWarning() {
21 | super.didReceiveMemoryWarning()
22 | // Dispose of any resources that can be recreated.
23 | }
24 |
25 | @IBAction func button1(sender: AnyObject) {
26 | //单个视图的过渡效果
27 | UIView.transitionWithView(view1, duration: 1.0, options: [UIViewAnimationOptions.CurveEaseInOut, .TransitionFlipFromBottom], animations: {
28 | self.view1.backgroundColor = UIColor.blueColor()
29 | }) { (_) in
30 | print("动画完成")
31 | }
32 |
33 |
34 | }
35 | @IBAction func button2(sender: AnyObject) {
36 | // let view2 = UIView(frame: CGRect(x: 100, y: 100, width: 100, height: 100))
37 |
38 | let view2 = UIView(frame: view1.frame)
39 |
40 | view2.backgroundColor = UIColor.redColor()
41 | UIView.transitionFromView(view1, toView: view2, duration: 2, options: UIViewAnimationOptions.TransitionCurlUp) { (_) in
42 | print("done")
43 | }
44 | }
45 |
46 | /*
47 | // MARK: - Navigation
48 |
49 | // In a storyboard-based application, you will often want to do a little preparation before navigation
50 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
51 | // Get the new view controller using segue.destinationViewController.
52 | // Pass the selected object to the new view controller.
53 | }
54 | */
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/Animation05ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Animation05ViewController.swift
3 | // 动画学习Demo
4 | //
5 | // Created by zhangkuo on 16/9/19.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class Animation05ViewController: UIViewController {
12 |
13 | @IBOutlet weak var view1: UIView!
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | // Do any additional setup after loading the view.
18 | }
19 |
20 | override func didReceiveMemoryWarning() {
21 | super.didReceiveMemoryWarning()
22 | // Dispose of any resources that can be recreated.
23 | }
24 |
25 | @IBAction func start(sender: AnyObject) {
26 | groupAni()
27 | }
28 |
29 |
30 | private func groupAni() {
31 |
32 | let posAni = CABasicAnimation(keyPath: "position")
33 | posAni.toValue = NSValue(CGPoint: CGPoint(x: 310, y: 400))
34 | let boundAni = CABasicAnimation(keyPath: "bounds")
35 | boundAni.toValue = NSValue(CGRect: CGRectMake(0, 0, 200, 200))
36 | let colorAni = CABasicAnimation(keyPath: "backgroundColor")
37 | colorAni.toValue = UIColor.redColor().CGColor
38 |
39 | let groupAni = CAAnimationGroup()
40 | groupAni.animations = [posAni, boundAni, colorAni]
41 | groupAni.duration = 1.5
42 | groupAni.fillMode = kCAFillModeForwards
43 | groupAni.removedOnCompletion = false
44 | groupAni.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
45 | view1.layer.addAnimation(groupAni, forKey: "groupAni")
46 |
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // 动画学习Demo
4 | //
5 | // Created by zhangkuo on 16/9/17.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(application: UIApplication) {
23 | // 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.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(application: UIApplication) {
28 | // 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.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(application: UIApplication) {
37 | // 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.
38 | }
39 |
40 | func applicationWillTerminate(application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/Assets.xcassets/dota2-0.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "dota2-0.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/Assets.xcassets/dota2-0.imageset/dota2-0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkuo24/iOS-Learn-Demo/3b6a71509c3809a2e77c553c0743696979bd6ceb/动画学习Demo/动画学习Demo/Assets.xcassets/dota2-0.imageset/dota2-0.jpg
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/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 |
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/HomeTableViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HomeTableViewController.swift
3 | // 动画学习Demo
4 | //
5 | // Created by zhangkuo on 16/9/17.
6 | // Copyright © 2016年 zhkuo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class HomeTableViewController: UITableViewController {
12 | let datas = ["1. UIView 开始结束动画","2. UIView Block 动画","3. UIView 转场动画","4. 核心动画","5. 核心动画-动画组"]
13 |
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 |
18 |
19 | }
20 |
21 | override func didReceiveMemoryWarning() {
22 | super.didReceiveMemoryWarning()
23 | // Dispose of any resources that can be recreated.
24 | }
25 |
26 | // MARK: - Table view data source
27 |
28 | override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
29 | // #warning Incomplete implementation, return the number of sections
30 | return 1
31 | }
32 |
33 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
34 | // #warning Incomplete implementation, return the number of rows
35 | return datas.count
36 | }
37 |
38 |
39 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
40 | let cell = tableView.dequeueReusableCellWithIdentifier("myCell", forIndexPath: indexPath)
41 |
42 | // Configure the cell...
43 | cell.textLabel?.text = datas[indexPath.row]
44 |
45 | return cell
46 | }
47 |
48 | override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
49 | switch indexPath.row {
50 | case 0:
51 | performSegueWithIdentifier("animation01", sender: nil)
52 | case 1:
53 | performSegueWithIdentifier("animation02", sender: nil)
54 | case 2:
55 | performSegueWithIdentifier("animation03", sender: nil)
56 | case 3:
57 | performSegueWithIdentifier("animation04", sender: nil)
58 | case 4:
59 | performSegueWithIdentifier("animation05", sender: nil)
60 | default:
61 | print("default")
62 | }
63 | }
64 |
65 |
66 |
67 | }
68 |
69 |
70 |
--------------------------------------------------------------------------------
/动画学习Demo/动画学习Demo/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 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------