├── .gitignore
├── LICENSE
├── README.md
└── YXViewPager
├── .swift-version
├── .travis.yml
├── Example
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Local Podspecs
│ │ └── YXViewPager.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ └── project.pbxproj
│ └── Target Support Files
│ │ ├── Pods-YXViewPager_Example
│ │ ├── Info.plist
│ │ ├── Pods-YXViewPager_Example-acknowledgements.markdown
│ │ ├── Pods-YXViewPager_Example-acknowledgements.plist
│ │ ├── Pods-YXViewPager_Example-dummy.m
│ │ ├── Pods-YXViewPager_Example-frameworks.sh
│ │ ├── Pods-YXViewPager_Example-resources.sh
│ │ ├── Pods-YXViewPager_Example-umbrella.h
│ │ ├── Pods-YXViewPager_Example.debug.xcconfig
│ │ ├── Pods-YXViewPager_Example.modulemap
│ │ └── Pods-YXViewPager_Example.release.xcconfig
│ │ ├── Pods-YXViewPager_Tests
│ │ ├── Info.plist
│ │ ├── Pods-YXViewPager_Tests-acknowledgements.markdown
│ │ ├── Pods-YXViewPager_Tests-acknowledgements.plist
│ │ ├── Pods-YXViewPager_Tests-dummy.m
│ │ ├── Pods-YXViewPager_Tests-frameworks.sh
│ │ ├── Pods-YXViewPager_Tests-resources.sh
│ │ ├── Pods-YXViewPager_Tests-umbrella.h
│ │ ├── Pods-YXViewPager_Tests.debug.xcconfig
│ │ ├── Pods-YXViewPager_Tests.modulemap
│ │ └── Pods-YXViewPager_Tests.release.xcconfig
│ │ └── YXViewPager
│ │ ├── Info.plist
│ │ ├── YXViewPager-dummy.m
│ │ ├── YXViewPager-prefix.pch
│ │ ├── YXViewPager-umbrella.h
│ │ ├── YXViewPager.modulemap
│ │ └── YXViewPager.xcconfig
├── Tests
│ ├── Tests-Info.plist
│ ├── Tests-Prefix.pch
│ ├── Tests.m
│ └── en.lproj
│ │ └── InfoPlist.strings
├── YXViewPager.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── YXViewPager-Example.xcscheme
├── YXViewPager.xcworkspace
│ └── contents.xcworkspacedata
└── YXViewPager
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Demo
│ ├── SubVC
│ │ ├── Cell
│ │ │ ├── YXViewPagerSubCell0.h
│ │ │ ├── YXViewPagerSubCell0.m
│ │ │ ├── YXViewPagerSubCell1.h
│ │ │ └── YXViewPagerSubCell1.m
│ │ ├── YXViewPagerSub0ViewController.h
│ │ ├── YXViewPagerSub0ViewController.m
│ │ ├── YXViewPagerSub1ViewController.h
│ │ ├── YXViewPagerSub1ViewController.m
│ │ ├── YXViewPagerSub2ViewController.h
│ │ ├── YXViewPagerSub2ViewController.m
│ │ ├── YXViewPagerSub3ViewController.h
│ │ ├── YXViewPagerSub3ViewController.m
│ │ ├── YXViewPagerSub4ViewController.h
│ │ ├── YXViewPagerSub4ViewController.m
│ │ ├── YXViewPagerSub5ViewController.h
│ │ ├── YXViewPagerSub5ViewController.m
│ │ ├── YXViewPagerSub6ViewController.h
│ │ ├── YXViewPagerSub6ViewController.m
│ │ ├── YXViewPagerSub7ViewController.h
│ │ ├── YXViewPagerSub7ViewController.m
│ │ ├── YXViewPagerSub8ViewController.h
│ │ └── YXViewPagerSub8ViewController.m
│ ├── YXViewPagerDemo1ViewController.h
│ ├── YXViewPagerDemo1ViewController.m
│ ├── YXViewPagerDemo2ViewController.h
│ ├── YXViewPagerDemo2ViewController.m
│ ├── YXViewPagerDemo3ViewController.h
│ ├── YXViewPagerDemo3ViewController.m
│ ├── YXViewPagerDemo4ViewController.h
│ ├── YXViewPagerDemo4ViewController.m
│ ├── YXViewPagerDemo5ViewController.h
│ ├── YXViewPagerDemo5ViewController.m
│ ├── YXViewPagerDemo6ViewController.h
│ ├── YXViewPagerDemo6ViewController.m
│ ├── YXViewPagerDemo7ViewController.h
│ ├── YXViewPagerDemo7ViewController.m
│ ├── YXViewPagerDemo8ViewController.h
│ └── YXViewPagerDemo8ViewController.m
│ ├── Images.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Contents.json
│ ├── car_select.imageset
│ │ ├── Contents.json
│ │ └── car_select@2x.png
│ ├── car_unselect.imageset
│ │ ├── Contents.json
│ │ └── car_unselect@2x.png
│ ├── flight_select.imageset
│ │ ├── Contents.json
│ │ └── flight_select@2x.png
│ ├── flight_unselect.imageset
│ │ ├── Contents.json
│ │ └── flight_unselect@2x.png
│ ├── fun_select.imageset
│ │ ├── Contents.json
│ │ └── fun_select@2x.png
│ ├── fun_unselect.imageset
│ │ ├── Contents.json
│ │ └── fun_unselect@2x.png
│ ├── girl0.imageset
│ │ ├── Contents.json
│ │ └── girl0.jpg
│ ├── girl1.imageset
│ │ ├── Contents.json
│ │ └── girl1.jpg
│ ├── home_select.imageset
│ │ ├── Contents.json
│ │ └── home_select@2x.png
│ ├── home_unselect.imageset
│ │ ├── Contents.json
│ │ └── home_unselect@2x.png
│ ├── hotel_select.imageset
│ │ ├── Contents.json
│ │ └── hotel_select@2x.png
│ ├── hotel_unselect.imageset
│ │ ├── Contents.json
│ │ └── hotel_unselect@2x.png
│ ├── icon_0_normal.imageset
│ │ ├── Contents.json
│ │ └── icon_0_normal.png
│ ├── icon_1_normal.imageset
│ │ ├── Contents.json
│ │ └── icon_1_normal.png
│ ├── icon_2_normal.imageset
│ │ ├── Contents.json
│ │ └── icon_2_normal.png
│ ├── icon_3_normal.imageset
│ │ ├── Contents.json
│ │ └── icon_3_normal.png
│ ├── icon_4_normal.imageset
│ │ ├── Contents.json
│ │ └── icon_4_normal.png
│ ├── ticket_select.imageset
│ │ ├── Contents.json
│ │ └── ticket_select@2x.png
│ ├── ticket_unselect.imageset
│ │ ├── Contents.json
│ │ └── ticket_unselect@2x.png
│ ├── transfer_select.imageset
│ │ ├── Contents.json
│ │ └── transfer_select@2x.png
│ ├── transfer_unselect.imageset
│ │ ├── Contents.json
│ │ └── transfer_unselect@2x.png
│ ├── visa_select.imageset
│ │ ├── Contents.json
│ │ └── visa_select@2x.png
│ ├── visa_unselect.imageset
│ │ ├── Contents.json
│ │ └── visa_unselect@2x.png
│ ├── wifi_select.imageset
│ │ ├── Contents.json
│ │ └── wifi_select@2x.png
│ └── wifi_unselect.imageset
│ │ ├── Contents.json
│ │ └── wifi_unselect@2x.png
│ ├── YXAppDelegate.h
│ ├── YXAppDelegate.m
│ ├── YXViewController.h
│ ├── YXViewController.m
│ ├── YXViewPager-Info.plist
│ ├── YXViewPager-Prefix.pch
│ ├── en.lproj
│ └── InfoPlist.strings
│ └── main.m
├── LICENSE
├── README.md
├── YXViewPager.podspec
├── YXViewPager
├── Assets
│ └── .gitkeep
└── Classes
│ ├── .gitkeep
│ ├── Delegate
│ ├── YXViewPagerEventDelegate.h
│ └── YXViewPagerSubVcScrollDelegate.h
│ ├── Model
│ ├── YXViewPagerConfigItemModel.h
│ ├── YXViewPagerConfigItemModel.m
│ ├── YXViewPagerConfigModel.h
│ ├── YXViewPagerConfigModel.m
│ ├── YXViewPagerItemViewModel.h
│ └── YXViewPagerItemViewModel.m
│ ├── Utility
│ ├── UIColor+YX.h
│ ├── UIColor+YX.m
│ ├── UIImage+YX.h
│ ├── UIImage+YX.m
│ ├── UIImageView+YX.h
│ ├── UIImageView+YX.m
│ ├── UIView+YX.h
│ ├── UIView+YX.m
│ ├── YXViewPagerDefine.h
│ └── YXViewPagerUtility.h
│ ├── VC
│ ├── YXViewPagerBaseSubViewController.h
│ ├── YXViewPagerBaseSubViewController.m
│ ├── YXViewPagerBaseViewController.h
│ └── YXViewPagerBaseViewController.m
│ ├── View
│ ├── YXViewPagerScrollView.h
│ ├── YXViewPagerScrollView.m
│ ├── YXViewPagerTopItemView.h
│ ├── YXViewPagerTopItemView.m
│ ├── YXViewPagerTopView.h
│ └── YXViewPagerTopView.m
│ └── YXViewPager.h
└── _Pods.xcodeproj
/.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 | # CocoaPods
31 | #
32 | # We recommend against adding the Pods directory to your .gitignore. However
33 | # you should judge for yourself, the pros and cons are mentioned at:
34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
35 | #
36 | # Pods/
37 |
38 | # Carthage
39 | #
40 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
41 | # Carthage/Checkouts
42 |
43 | Carthage/Build
44 |
45 | # fastlane
46 | #
47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48 | # screenshots whenever they are needed.
49 | # For more information about the recommended setup visit:
50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
51 |
52 | fastlane/report.xml
53 | fastlane/screenshots
54 |
55 | #Code Injection
56 | #
57 | # After new code Injection tools there's a generated folder /iOSInjectionProject
58 | # https://github.com/johnno1962/injectionforxcode
59 |
60 | iOSInjectionProject/
61 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 yixiangboy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 一、简述
2 | 现在的App也来越关注用户的体验,如果你们需求是做一个让别人轻松逛一逛的界面的话,像这种可以左右滑动切换Tab的多界面交互效果是非常适合的,不需要用户过多的点击,左右滑动的交互效果让体验更加良好。比如手淘首页中“淘抢购”,“有好货”,“男神范”,“必买清单”都是这种交互方式。我们飞猪在做出境超市首页Native化、周边好去处项目、全球第一站项目,也是采取这种交互方式,项目也顺利完成,在交互效果上大家评价都还不错,我花了一点时间,去掉了一些业务代码,对代码重构了一下,提取出了可以开源的部分代码,供大家做一个参考。[项目地址](https://github.com/yixiangboy/YXViewPager)
3 | # 二、可以实现的效果展示
4 | | 效果 | 展示 |
5 | | ------------- |:-------------:|
6 | | 图片+文字切换效果
**淘宝有好货** |
|
7 | | 单独文字切换效果
**淘宝有好货** |
|
8 | | 单独图片切换效果
**淘宝有好货** |
|
9 | | 图片+文字选中切换效果
**出境超市** |
|
10 | |超过一屏时候的切换效果
**出境超市**|
|
11 | |复杂遮罩切换效果
**全球第一战、周边好去处**|
|
12 |
13 | # 三、如何使用
14 | * **1、页面主体框架页面需要继承于YXViewPagerBaseViewController。**
15 | * **2、里面每一个tab下面的子页面,需要继承于YXViewPagerBaseSubViewController。**
16 | * **3、在页面主体框架页面中重写- (NSDictionary \*)getPageConfigInfo;方法。**
17 | 返回的pageConfig即为本框架的主体内容,可以设置的属性如下
18 |
19 | | 属性名称 | 属性效果 |
20 | | ------------- |:-------------:|
21 | | topViewBgColor| 背景色|
22 | | maskColor| 第一遮罩颜色|
23 | | maskHeight| 第一遮罩高度 默认和父类一样高|
24 | | maskWidth| 第一遮罩宽度 默认和父类一样宽|
25 | | needSecondaryMask| 是否需要第二遮罩|
26 | | secondaryMaskColor| 第二遮罩颜色|
27 | | secondaryMaskColorAlpha| 第二遮罩层颜色的alpha值|
28 | | maskPositionType| 遮罩位置 0:占据整个高度 1:顶部 2: 顶部|
29 | | type|显示类型 0:总宽度为屏幕宽度,不可滚动,每个item的宽度,根据item的个数确定。适合item数比较少的情况 1:每个item的宽度确定,超过屏幕可以滑动。适合item数比较多的情况|
30 | | itemWidth|每一个item显示的宽度|
31 | | items|每一个items的信息集合|
32 |
33 |
34 | * 4、**items每一个item可以设置的属性如下:**
35 |
36 |
37 | | 属性名称 | 属性效果 |
38 | | ------------- |:-------------:|
39 | | itemType| 显示模式 0: 文本 1: 图片 2: 图文混排|
40 | | title| 标题|
41 | | normalTitleColor| 未选中标题颜色|
42 | | selectTitleColor| 选中标题颜色|
43 | | normalIconName| 未选中图标|
44 | | selectIconName| 选中图标|
45 | | imageType| 图片类型 0: 本地图片 1:网络图片|
46 | | vcName| 该item对应的ViewController的名称|
47 |
48 |
49 | * 5、**在合适的实际调用渲染函数**
50 |
51 | ```
52 | [self renderUI];//渲染主框架
53 | [self tabItemSelected:0 needAnimation:NO];//主框架定位到第几个tab
54 |
55 | ```
56 |
57 | * 6、**主框架把数据传给里面每一个子页面**
58 | 在主框架中,重写- (NSDictionary *)rootToSubInfo;返回的数据既可以在子页面中收到。
59 |
60 | ```
61 | - (NSDictionary *)rootToSubInfo{
62 | NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
63 | //添加参数
64 | return dic;
65 | }
66 | ```
67 |
68 | 子页面重写 - (void)setRootToSubInfo:(NSDictionary *)rootToSubInfo方法,rootToSubInfo即为主框架传递过来的信息
69 |
70 | ```
71 | - (void)setRootToSubInfo:(NSDictionary *)rootToSubInfo{
72 | //在这里处理主框架传递过来的参数信息
73 | }
74 | ```
75 |
76 | * 7、**子页面把数据传给主框架,其实在渲染主框架的时候,主框架作为代理,传给了子页面。**
77 | 我们可以在子页面中调用对应的代理方法即可。
78 |
79 | ```
80 | [self.delegate handleEventWithEventName:@"jumpOtherType" context:@{@"index":@4}];
81 | ```
82 | 然后在主框架中实现代理方法即可。
83 |
84 | ```
85 | - (void)handleEventWithEventName:(NSString *)eventName context:(NSDictionary *)context{
86 | NSLog(@"eventName == %@",eventName);
87 | NSLog(@"content == %@",context);
88 | if (!STRING_IS_BLANK(eventName)) {
89 | if ([eventName isEqualToString:@"jumpOtherType"]) {
90 | NSInteger index = [context[@"index"] integerValue];
91 | [self tabItemSelected:index];
92 | }
93 | }
94 | }
95 | ```
96 |
97 | * 8、**默认开启沉浸式titleBar效果**
98 | 如果需要关闭,该功能的话,在主框架中,重写- (BOOL)needMagicTitleBar;返回NO即可。
99 |
100 | * 9、**默认支持左滑返回事件**
101 |
102 |
103 | # 四、联系方式
104 | [新浪微博](http://weibo.com/5612984599/info)
105 |
106 | [github](https://github.com/yixiangboy)
107 |
108 | [简书首页](http://www.jianshu.com/users/c3c893a27097/timeline)
109 |
110 | 如果感觉有用,star一下吧~ ~。
111 |
--------------------------------------------------------------------------------
/YXViewPager/.swift-version:
--------------------------------------------------------------------------------
1 | 2.3
2 |
--------------------------------------------------------------------------------
/YXViewPager/.travis.yml:
--------------------------------------------------------------------------------
1 | # references:
2 | # * http://www.objc.io/issue-6/travis-ci.html
3 | # * https://github.com/supermarin/xcpretty#usage
4 |
5 | osx_image: xcode7.3
6 | language: objective-c
7 | # cache: cocoapods
8 | # podfile: Example/Podfile
9 | # before_install:
10 | # - gem install cocoapods # Since Travis is not always on latest version
11 | # - pod install --project-directory=Example
12 | script:
13 | - set -o pipefail && xcodebuild test -workspace Example/YXViewPager.xcworkspace -scheme YXViewPager-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
14 | - pod lib lint
15 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 |
3 | target 'YXViewPager_Example' do
4 | pod 'YXViewPager', :path => '../'
5 |
6 | target 'YXViewPager_Tests' do
7 | inherit! :search_paths
8 |
9 |
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - YXViewPager (0.1.0)
3 |
4 | DEPENDENCIES:
5 | - YXViewPager (from `../`)
6 |
7 | EXTERNAL SOURCES:
8 | YXViewPager:
9 | :path: "../"
10 |
11 | SPEC CHECKSUMS:
12 | YXViewPager: eee2a54aabf723baa59b7ba345babd27b1bb80ae
13 |
14 | PODFILE CHECKSUM: cacf4d91ef9562d8985dd79bb7ae8fa5a269e81f
15 |
16 | COCOAPODS: 1.1.1
17 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Local Podspecs/YXViewPager.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "YXViewPager",
3 | "version": "0.1.0",
4 | "summary": "A short description of YXViewPager.",
5 | "description": "TODO: Add long description of the pod here.",
6 | "homepage": "https://github.com/yixiangboy/YXViewPager",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "yixiangboy": "yixiang.yx@alibaba-inc.com"
13 | },
14 | "source": {
15 | "git": "https://github.com/yixiangboy/YXViewPager.git",
16 | "tag": "0.1.0"
17 | },
18 | "platforms": {
19 | "ios": "8.0"
20 | },
21 | "source_files": "YXViewPager/Classes/**/*"
22 | }
23 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - YXViewPager (0.1.0)
3 |
4 | DEPENDENCIES:
5 | - YXViewPager (from `../`)
6 |
7 | EXTERNAL SOURCES:
8 | YXViewPager:
9 | :path: "../"
10 |
11 | SPEC CHECKSUMS:
12 | YXViewPager: eee2a54aabf723baa59b7ba345babd27b1bb80ae
13 |
14 | PODFILE CHECKSUM: cacf4d91ef9562d8985dd79bb7ae8fa5a269e81f
15 |
16 | COCOAPODS: 1.1.1
17 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/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 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/Pods-YXViewPager_Example-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## YXViewPager
5 |
6 | Copyright (c) 2017 yixiangboy
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 | Generated by CocoaPods - https://cocoapods.org
27 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/Pods-YXViewPager_Example-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2017 yixiangboy <yixiang.yx@alibaba-inc.com>
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is
24 | furnished to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in
27 | all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 | License
38 | MIT
39 | Title
40 | YXViewPager
41 | Type
42 | PSGroupSpecifier
43 |
44 |
45 | FooterText
46 | Generated by CocoaPods - https://cocoapods.org
47 | Title
48 |
49 | Type
50 | PSGroupSpecifier
51 |
52 |
53 | StringsTable
54 | Acknowledgements
55 | Title
56 | Acknowledgements
57 |
58 |
59 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/Pods-YXViewPager_Example-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_YXViewPager_Example : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_YXViewPager_Example
5 | @end
6 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/Pods-YXViewPager_Example-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
64 | fi
65 | }
66 |
67 | # Strip invalid architectures
68 | strip_invalid_archs() {
69 | binary="$1"
70 | # Get architectures for current file
71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
72 | stripped=""
73 | for arch in $archs; do
74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
75 | # Strip non-valid architectures in-place
76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
77 | stripped="$stripped $arch"
78 | fi
79 | done
80 | if [[ "$stripped" ]]; then
81 | echo "Stripped $binary of architectures:$stripped"
82 | fi
83 | }
84 |
85 |
86 | if [[ "$CONFIGURATION" == "Debug" ]]; then
87 | install_framework "$BUILT_PRODUCTS_DIR/YXViewPager/YXViewPager.framework"
88 | fi
89 | if [[ "$CONFIGURATION" == "Release" ]]; then
90 | install_framework "$BUILT_PRODUCTS_DIR/YXViewPager/YXViewPager.framework"
91 | fi
92 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/Pods-YXViewPager_Example-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | *)
22 | TARGET_DEVICE_ARGS="--target-device mac"
23 | ;;
24 | esac
25 |
26 | install_resource()
27 | {
28 | if [[ "$1" = /* ]] ; then
29 | RESOURCE_PATH="$1"
30 | else
31 | RESOURCE_PATH="${PODS_ROOT}/$1"
32 | fi
33 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
34 | cat << EOM
35 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
36 | EOM
37 | exit 1
38 | fi
39 | case $RESOURCE_PATH in
40 | *.storyboard)
41 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
42 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
43 | ;;
44 | *.xib)
45 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
46 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
47 | ;;
48 | *.framework)
49 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
50 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
51 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
52 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
53 | ;;
54 | *.xcdatamodel)
55 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
56 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
57 | ;;
58 | *.xcdatamodeld)
59 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
60 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
61 | ;;
62 | *.xcmappingmodel)
63 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
64 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
65 | ;;
66 | *.xcassets)
67 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
68 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
69 | ;;
70 | *)
71 | echo "$RESOURCE_PATH"
72 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
73 | ;;
74 | esac
75 | }
76 |
77 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
78 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
79 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
80 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
82 | fi
83 | rm -f "$RESOURCES_TO_COPY"
84 |
85 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
86 | then
87 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
88 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
89 | while read line; do
90 | if [[ $line != "${PODS_ROOT}*" ]]; then
91 | XCASSET_FILES+=("$line")
92 | fi
93 | done <<<"$OTHER_XCASSETS"
94 |
95 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | fi
97 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/Pods-YXViewPager_Example-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
6 | FOUNDATION_EXPORT double Pods_YXViewPager_ExampleVersionNumber;
7 | FOUNDATION_EXPORT const unsigned char Pods_YXViewPager_ExampleVersionString[];
8 |
9 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/Pods-YXViewPager_Example.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/YXViewPager"
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/YXViewPager/YXViewPager.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "YXViewPager"
7 | PODS_BUILD_DIR = $BUILD_DIR
8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/Pods-YXViewPager_Example.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_YXViewPager_Example {
2 | umbrella header "Pods-YXViewPager_Example-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Example/Pods-YXViewPager_Example.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/YXViewPager"
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/YXViewPager/YXViewPager.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "YXViewPager"
7 | PODS_BUILD_DIR = $BUILD_DIR
8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/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 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/Pods-YXViewPager_Tests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/Pods-YXViewPager_Tests-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/Pods-YXViewPager_Tests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_YXViewPager_Tests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_YXViewPager_Tests
5 | @end
6 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/Pods-YXViewPager_Tests-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
64 | fi
65 | }
66 |
67 | # Strip invalid architectures
68 | strip_invalid_archs() {
69 | binary="$1"
70 | # Get architectures for current file
71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
72 | stripped=""
73 | for arch in $archs; do
74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
75 | # Strip non-valid architectures in-place
76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
77 | stripped="$stripped $arch"
78 | fi
79 | done
80 | if [[ "$stripped" ]]; then
81 | echo "Stripped $binary of architectures:$stripped"
82 | fi
83 | }
84 |
85 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/Pods-YXViewPager_Tests-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | *)
22 | TARGET_DEVICE_ARGS="--target-device mac"
23 | ;;
24 | esac
25 |
26 | install_resource()
27 | {
28 | if [[ "$1" = /* ]] ; then
29 | RESOURCE_PATH="$1"
30 | else
31 | RESOURCE_PATH="${PODS_ROOT}/$1"
32 | fi
33 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
34 | cat << EOM
35 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
36 | EOM
37 | exit 1
38 | fi
39 | case $RESOURCE_PATH in
40 | *.storyboard)
41 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
42 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
43 | ;;
44 | *.xib)
45 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
46 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
47 | ;;
48 | *.framework)
49 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
50 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
51 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
52 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
53 | ;;
54 | *.xcdatamodel)
55 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
56 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
57 | ;;
58 | *.xcdatamodeld)
59 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
60 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
61 | ;;
62 | *.xcmappingmodel)
63 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
64 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
65 | ;;
66 | *.xcassets)
67 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
68 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
69 | ;;
70 | *)
71 | echo "$RESOURCE_PATH"
72 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
73 | ;;
74 | esac
75 | }
76 |
77 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
78 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
79 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
80 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
82 | fi
83 | rm -f "$RESOURCES_TO_COPY"
84 |
85 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
86 | then
87 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
88 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
89 | while read line; do
90 | if [[ $line != "${PODS_ROOT}*" ]]; then
91 | XCASSET_FILES+=("$line")
92 | fi
93 | done <<<"$OTHER_XCASSETS"
94 |
95 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | fi
97 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/Pods-YXViewPager_Tests-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
6 | FOUNDATION_EXPORT double Pods_YXViewPager_TestsVersionNumber;
7 | FOUNDATION_EXPORT const unsigned char Pods_YXViewPager_TestsVersionString[];
8 |
9 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/Pods-YXViewPager_Tests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/YXViewPager"
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/YXViewPager/YXViewPager.framework/Headers"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/Pods-YXViewPager_Tests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_YXViewPager_Tests {
2 | umbrella header "Pods-YXViewPager_Tests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/Pods-YXViewPager_Tests/Pods-YXViewPager_Tests.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/YXViewPager"
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/YXViewPager/YXViewPager.framework/Headers"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/YXViewPager/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 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/YXViewPager/YXViewPager-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_YXViewPager : NSObject
3 | @end
4 | @implementation PodsDummy_YXViewPager
5 | @end
6 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/YXViewPager/YXViewPager-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/YXViewPager/YXViewPager-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 | #import "YXViewPagerEventDelegate.h"
6 | #import "UIColor+YX.h"
7 | #import "UIView+YX.h"
8 | #import "YXViewPagerDefine.h"
9 | #import "YXViewPagerUtility.h"
10 | #import "YXViewPagerBaseSubViewController.h"
11 | #import "YXViewPagerBaseViewController.h"
12 | #import "YXViewPagerItemViewModel.h"
13 | #import "YXViewPagerTopItemView.h"
14 | #import "YXViewPagerTopView.h"
15 | #import "YXViewPager.h"
16 |
17 | FOUNDATION_EXPORT double YXViewPagerVersionNumber;
18 | FOUNDATION_EXPORT const unsigned char YXViewPagerVersionString[];
19 |
20 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/YXViewPager/YXViewPager.modulemap:
--------------------------------------------------------------------------------
1 | framework module YXViewPager {
2 | umbrella header "YXViewPager-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Pods/Target Support Files/YXViewPager/YXViewPager.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YXViewPager
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 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Tests/Tests-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 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Tests/Tests-Prefix.pch:
--------------------------------------------------------------------------------
1 | // The contents of this file are implicitly included at the beginning of every test case source file.
2 |
3 | #ifdef __OBJC__
4 |
5 |
6 |
7 | #endif
8 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Tests/Tests.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerTests.m
3 | // YXViewPagerTests
4 | //
5 | // Created by yixiangboy on 03/29/2017.
6 | // Copyright (c) 2017 yixiangboy. All rights reserved.
7 | //
8 |
9 | @import XCTest;
10 |
11 | @interface Tests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation Tests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
36 |
--------------------------------------------------------------------------------
/YXViewPager/Example/Tests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager.xcodeproj/xcshareddata/xcschemes/YXViewPager-Example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
76 |
77 |
83 |
85 |
91 |
92 |
93 |
94 |
96 |
97 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/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 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/Cell/YXViewPagerSubCell0.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSubCell0.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/30.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSubCell0 : UICollectionViewCell
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/Cell/YXViewPagerSubCell0.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSubCell0.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/30.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSubCell0.h"
10 | #import
11 |
12 | @interface YXViewPagerSubCell0()
13 |
14 | @property (nonatomic, strong) UIImageView *iconView;
15 | @property (nonatomic, strong) UILabel *titleView;
16 | @property (nonatomic, strong) UILabel *detailView;
17 | @property (nonatomic, strong) UILabel *bottomView;
18 |
19 | @end
20 |
21 | @implementation YXViewPagerSubCell0
22 |
23 | - (instancetype)initWithFrame:(CGRect)frame{
24 | self = [super initWithFrame:frame];
25 | if (self) {
26 | _iconView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, self.height-20, self.height-20)];
27 | _iconView.image = [UIImage imageNamed:@"girl0.jpg"];
28 | [self addSubview:_iconView];
29 |
30 | _titleView = [[UILabel alloc] initWithFrame:CGRectMake(_iconView.right+10, 10, self.width-_iconView.right-20, 18)];
31 | _titleView.backgroundColor = [UIColor colorWithHexString:@"#F6F6F6"];
32 | _titleView.text = @"我是林明祯";
33 | _titleView.font = [UIFont systemFontOfSize:18];
34 | _titleView.textColor = [UIColor colorWithHexString:@"#3D3D3D"];
35 | [self addSubview:_titleView];
36 |
37 | _detailView = [[UILabel alloc] initWithFrame:CGRectMake(_titleView.left, _titleView.bottom+2, _titleView.width, 36)];
38 | _detailView.backgroundColor = [UIColor colorWithHexString:@"#F6F6F6"];
39 | _detailView.text = @"薛之谦MV刚刚好女主角";
40 | _detailView.numberOfLines = 2;
41 | _detailView.font = [UIFont systemFontOfSize:16];
42 | _detailView.textColor = [UIColor colorWithHexString:@"#3D3D3D"];
43 | [self addSubview:_detailView];
44 |
45 | _bottomView = [[UILabel alloc] initWithFrame:CGRectMake(_titleView.left, self.height-10-16, _titleView.width, 16)];
46 | _bottomView.backgroundColor = [UIColor colorWithHexString:@"#F6F6F6"];
47 | _bottomView.text = @"粉丝约会节";
48 | _bottomView.font = [UIFont systemFontOfSize:16];
49 | _bottomView.textColor = [UIColor colorWithHexString:@"#3D3D3D"];
50 | [self addSubview:_bottomView];
51 | }
52 | return self;
53 | }
54 |
55 |
56 | @end
57 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/Cell/YXViewPagerSubCell1.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSubCell1.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/30.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSubCell1 : UICollectionViewCell
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/Cell/YXViewPagerSubCell1.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSubCell1.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/30.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSubCell1.h"
10 | #import
11 |
12 | @interface YXViewPagerSubCell1()
13 |
14 | @property (nonatomic, strong) UIImageView *iconView;
15 | @property (nonatomic, strong) UILabel *titleView;
16 | @property (nonatomic, strong) UILabel *detailView;
17 |
18 | @end
19 |
20 | @implementation YXViewPagerSubCell1
21 |
22 | - (instancetype)initWithFrame:(CGRect)frame{
23 | self = [super initWithFrame:frame];
24 | if (self) {
25 | _iconView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, self.width-20, self.width-20)];
26 | _iconView.image = [UIImage imageNamed:@"girl1.jpg"];
27 | [self addSubview:_iconView];
28 |
29 | _titleView = [[UILabel alloc] initWithFrame:CGRectMake(10, _iconView.bottom+2, _iconView.width, 18)];
30 | _titleView.backgroundColor = [UIColor colorWithHexString:@"#F6F6F6"];
31 | _titleView.text = @"我是周二珂";
32 | _titleView.font = [UIFont systemFontOfSize:18];
33 | _titleView.textColor = [UIColor colorWithHexString:@"#3D3D3D"];
34 | [self addSubview:_titleView];
35 |
36 | _detailView = [[UILabel alloc] initWithFrame:CGRectMake(10, self.height-2-16, _iconView.width, 16)];
37 | _detailView.backgroundColor = [UIColor colorWithHexString:@"#F6F6F6"];
38 | _detailView.text = @"告白气球";
39 | _detailView.font = [UIFont systemFontOfSize:16];
40 | _detailView.textColor = [UIColor colorWithHexString:@"#3D3D3D"];
41 | [self addSubview:_detailView];
42 | }
43 | return self;
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub0ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub0ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSub0ViewController : YXViewPagerBaseSubViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub0ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub0ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSub0ViewController.h"
10 | #import "YXViewPagerSubCell0.h"
11 |
12 | static NSString *const kCellid = @"kCellid";
13 |
14 | @interface YXViewPagerSub0ViewController ()
15 |
16 | @property (nonatomic, strong) UICollectionView *collectionView;
17 |
18 | @end
19 |
20 | @implementation YXViewPagerSub0ViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
26 | _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
27 | _collectionView.delegate = self;
28 | _collectionView.dataSource = self;
29 | _collectionView.backgroundColor = [UIColor whiteColor];
30 | [self.view addSubview:_collectionView];
31 |
32 | [_collectionView registerClass:[YXViewPagerSubCell0 class] forCellWithReuseIdentifier:kCellid];
33 | }
34 |
35 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
36 | return 1;
37 | }
38 |
39 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
40 | return 20;
41 | }
42 |
43 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
44 |
45 | YXViewPagerSubCell0 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellid forIndexPath:indexPath];
46 |
47 | return cell;
48 | }
49 |
50 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
51 | return CGSizeMake(self.view.width,120);
52 | }
53 |
54 | - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
55 | return 0.;
56 | }
57 |
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub1ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub1ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSub1ViewController : YXViewPagerBaseSubViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub1ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub1ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSub1ViewController.h"
10 | #import "YXViewPagerSubCell1.h"
11 |
12 | static NSString *const kCellid = @"kCellid";
13 |
14 | @interface YXViewPagerSub1ViewController ()
15 |
16 | @property (nonatomic, strong) UICollectionView *collectionView;
17 |
18 | @end
19 |
20 | @implementation YXViewPagerSub1ViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
26 | _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
27 | _collectionView.delegate = self;
28 | _collectionView.dataSource = self;
29 | _collectionView.backgroundColor = [UIColor whiteColor];
30 | [self.view addSubview:_collectionView];
31 |
32 | [_collectionView registerClass:[YXViewPagerSubCell1 class] forCellWithReuseIdentifier:kCellid];
33 | }
34 |
35 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
36 | return 1;
37 | }
38 |
39 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
40 | return 40;
41 | }
42 |
43 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
44 |
45 | YXViewPagerSubCell1 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellid forIndexPath:indexPath];
46 |
47 | return cell;
48 | }
49 |
50 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
51 | CGFloat width = self.view.width/2-12;
52 | return CGSizeMake(width,width+32);
53 | }
54 |
55 | - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
56 | return 0.;
57 | }
58 |
59 |
60 |
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub2ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub2ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSub2ViewController : YXViewPagerBaseSubViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub2ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub2ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSub2ViewController.h"
10 | #import "YXViewPagerSubCell0.h"
11 |
12 | static NSString *const kCellid = @"kCellid";
13 |
14 | @interface YXViewPagerSub2ViewController ()
15 |
16 | @property (nonatomic, strong) UICollectionView *collectionView;
17 |
18 | @end
19 |
20 | @implementation YXViewPagerSub2ViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
26 | _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
27 | _collectionView.delegate = self;
28 | _collectionView.dataSource = self;
29 | _collectionView.backgroundColor = [UIColor whiteColor];
30 | [self.view addSubview:_collectionView];
31 |
32 | [_collectionView registerClass:[YXViewPagerSubCell0 class] forCellWithReuseIdentifier:kCellid];
33 | }
34 |
35 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
36 | return 1;
37 | }
38 |
39 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
40 | return 20;
41 | }
42 |
43 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
44 |
45 | YXViewPagerSubCell0 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellid forIndexPath:indexPath];
46 |
47 | return cell;
48 | }
49 |
50 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
51 | return CGSizeMake(self.view.width,120);
52 | }
53 |
54 | - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
55 | return 0.;
56 | }
57 |
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub3ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub3ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSub3ViewController : YXViewPagerBaseSubViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub3ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub3ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSub3ViewController.h"
10 | #import "YXViewPagerSubCell1.h"
11 |
12 | static NSString *const kCellid = @"kCellid";
13 |
14 | @interface YXViewPagerSub3ViewController ()
15 |
16 | @property (nonatomic, strong) UICollectionView *collectionView;
17 |
18 | @end
19 |
20 | @implementation YXViewPagerSub3ViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
26 | _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
27 | _collectionView.delegate = self;
28 | _collectionView.dataSource = self;
29 | _collectionView.backgroundColor = [UIColor whiteColor];
30 | [self.view addSubview:_collectionView];
31 |
32 | [_collectionView registerClass:[YXViewPagerSubCell1 class] forCellWithReuseIdentifier:kCellid];
33 | }
34 |
35 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
36 | return 1;
37 | }
38 |
39 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
40 | return 40;
41 | }
42 |
43 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
44 |
45 | YXViewPagerSubCell1 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellid forIndexPath:indexPath];
46 |
47 | return cell;
48 | }
49 |
50 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
51 | CGFloat width = self.view.width/2-12;
52 | return CGSizeMake(width,width+32);
53 | }
54 |
55 | - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
56 | return 0.;
57 | }
58 |
59 |
60 |
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub4ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub4ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSub4ViewController : YXViewPagerBaseSubViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub4ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub4ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSub4ViewController.h"
10 | #import "YXViewPagerSubCell0.h"
11 |
12 | static NSString *const kCellid = @"kCellid";
13 |
14 | @interface YXViewPagerSub4ViewController ()
15 |
16 | @property (nonatomic, strong) UICollectionView *collectionView;
17 |
18 | @end
19 |
20 | @implementation YXViewPagerSub4ViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
26 | _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
27 | _collectionView.delegate = self;
28 | _collectionView.dataSource = self;
29 | _collectionView.backgroundColor = [UIColor whiteColor];
30 | [self.view addSubview:_collectionView];
31 |
32 | [_collectionView registerClass:[YXViewPagerSubCell0 class] forCellWithReuseIdentifier:kCellid];
33 | }
34 |
35 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
36 | return 1;
37 | }
38 |
39 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
40 | return 20;
41 | }
42 |
43 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
44 |
45 | YXViewPagerSubCell0 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellid forIndexPath:indexPath];
46 |
47 | return cell;
48 | }
49 |
50 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
51 | return CGSizeMake(self.view.width,120);
52 | }
53 |
54 | - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
55 | return 0.;
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub5ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub5ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSub5ViewController : YXViewPagerBaseSubViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub5ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub5ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSub5ViewController.h"
10 | #import "YXViewPagerSubCell1.h"
11 |
12 | static NSString *const kCellid = @"kCellid";
13 |
14 | @interface YXViewPagerSub5ViewController ()
15 |
16 | @property (nonatomic, strong) UICollectionView *collectionView;
17 |
18 | @end
19 |
20 | @implementation YXViewPagerSub5ViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
26 | _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
27 | _collectionView.delegate = self;
28 | _collectionView.dataSource = self;
29 | _collectionView.backgroundColor = [UIColor whiteColor];
30 | [self.view addSubview:_collectionView];
31 |
32 | [_collectionView registerClass:[YXViewPagerSubCell1 class] forCellWithReuseIdentifier:kCellid];
33 | }
34 |
35 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
36 | return 1;
37 | }
38 |
39 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
40 | return 40;
41 | }
42 |
43 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
44 |
45 | YXViewPagerSubCell1 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellid forIndexPath:indexPath];
46 |
47 | return cell;
48 | }
49 |
50 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
51 | CGFloat width = self.view.width/2-12;
52 | return CGSizeMake(width,width+32);
53 | }
54 |
55 | - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
56 | return 0.;
57 | }
58 |
59 |
60 |
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub6ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub6ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSub6ViewController : YXViewPagerBaseSubViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub6ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub6ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSub6ViewController.h"
10 | #import "YXViewPagerSubCell0.h"
11 |
12 | static NSString *const kCellid = @"kCellid";
13 |
14 | @interface YXViewPagerSub6ViewController ()
15 |
16 | @property (nonatomic, strong) UICollectionView *collectionView;
17 |
18 | @end
19 |
20 | @implementation YXViewPagerSub6ViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
26 | _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
27 | _collectionView.delegate = self;
28 | _collectionView.dataSource = self;
29 | _collectionView.backgroundColor = [UIColor whiteColor];
30 | [self.view addSubview:_collectionView];
31 |
32 | [_collectionView registerClass:[YXViewPagerSubCell0 class] forCellWithReuseIdentifier:kCellid];
33 | }
34 |
35 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
36 | return 1;
37 | }
38 |
39 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
40 | return 20;
41 | }
42 |
43 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
44 |
45 | YXViewPagerSubCell0 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellid forIndexPath:indexPath];
46 |
47 | return cell;
48 | }
49 |
50 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
51 | return CGSizeMake(self.view.width,120);
52 | }
53 |
54 | - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
55 | return 0.;
56 | }
57 |
58 |
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub7ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub7ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSub7ViewController : YXViewPagerBaseSubViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub7ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub7ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSub7ViewController.h"
10 | #import "YXViewPagerSubCell1.h"
11 |
12 | static NSString *const kCellid = @"kCellid";
13 |
14 | @interface YXViewPagerSub7ViewController ()
15 |
16 | @property (nonatomic, strong) UICollectionView *collectionView;
17 |
18 | @end
19 |
20 | @implementation YXViewPagerSub7ViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 |
25 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
26 | _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
27 | _collectionView.delegate = self;
28 | _collectionView.dataSource = self;
29 | _collectionView.backgroundColor = [UIColor whiteColor];
30 | [self.view addSubview:_collectionView];
31 |
32 | [_collectionView registerClass:[YXViewPagerSubCell1 class] forCellWithReuseIdentifier:kCellid];
33 | }
34 |
35 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
36 | return 1;
37 | }
38 |
39 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
40 | return 40;
41 | }
42 |
43 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
44 |
45 | YXViewPagerSubCell1 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellid forIndexPath:indexPath];
46 |
47 | return cell;
48 | }
49 |
50 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
51 | CGFloat width = self.view.width/2-12;
52 | return CGSizeMake(width,width+32);
53 | }
54 |
55 | - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
56 | return 0.;
57 | }
58 |
59 |
60 |
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub8ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub8ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerSub8ViewController : YXViewPagerBaseSubViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/SubVC/YXViewPagerSub8ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSub8ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerSub8ViewController.h"
10 | #import "YXViewPagerSub0ViewController.h"
11 |
12 |
13 | @interface YXViewPagerSub8ViewController ()
14 |
15 |
16 | @end
17 |
18 | @implementation YXViewPagerSub8ViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | NSLog(@"Sub1 viewDidLoad");
23 |
24 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 200, self.view.width, 50)];
25 | [btn setTitle:@"点击跳转到其他界面" forState:UIControlStateNormal];
26 | [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
27 | [btn addTarget:self action:@selector(jump) forControlEvents:UIControlEventTouchUpInside];
28 | [self.view addSubview:btn];
29 |
30 | UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(0, 260, self.view.width, 50)];
31 | [btn2 setTitle:@"点击跳转到其他Type" forState:UIControlStateNormal];
32 | [btn2 setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
33 | [btn2 addTarget:self action:@selector(jump2) forControlEvents:UIControlEventTouchUpInside];
34 | [self.view addSubview:btn2];
35 | }
36 |
37 | - (void)jump{
38 | [self.rootVc.navigationController pushViewController:[[YXViewPagerSub0ViewController alloc] init] animated:YES];
39 | }
40 |
41 | - (void)jump2{
42 | [self.delegate handleEventWithEventName:@"jumpOtherType" context:@{@"index":@4}];
43 | }
44 |
45 | - (void)viewWillAppear:(BOOL)animated{
46 | [super viewWillAppear:animated];
47 | NSLog(@"Sub1 viewWillAppear");
48 | }
49 |
50 | - (void)viewDidAppear:(BOOL)animated{
51 | [super viewDidAppear:animated];
52 | NSLog(@"Sub1 viewDidAppear");
53 | }
54 |
55 | - (void)viewWillDisappear:(BOOL)animated{
56 | [super viewWillDisappear:animated];
57 | NSLog(@"Sub1 viewWillDisappear");
58 | }
59 |
60 | - (void)viewDidDisappear:(BOOL)animated{
61 | [super viewDidDisappear:animated];
62 | NSLog(@"Sub1 viewDidDisappear");
63 | }
64 |
65 | - (void)dealloc{
66 |
67 | }
68 |
69 |
70 | @end
71 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo1ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo1ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerBaseViewController.h"
10 |
11 | @interface YXViewPagerDemo1ViewController : YXViewPagerBaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo1ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo1ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerDemo1ViewController.h"
10 |
11 | @interface YXViewPagerDemo1ViewController ()
12 |
13 | @end
14 |
15 | @implementation YXViewPagerDemo1ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | self.title = @"图片+文字";
20 | NSLog(@"Demo1 viewDidLoad");
21 | [self renderUI];
22 | [self tabItemSelected:0 needAnimation:NO];
23 | }
24 |
25 | - (void)dealloc{
26 |
27 | }
28 |
29 | - (NSDictionary *)getPageConfigInfo{
30 | NSDictionary *configInfo = @{
31 | @"topViewBgColor":@"#282B31",
32 | @"maskColor":@"#269FE7",
33 | @"type":@0,
34 | @"items":@[@{
35 | @"itemType":@2,
36 | @"title":@"精选",
37 | @"normalTitleColor":@"#FFFFFF",
38 | @"selectTitleColor":@"#FFFFFF",
39 | @"normalIconName":@"icon_0_normal",
40 | @"selectIconName":@"icon_0_normal",
41 | @"imageType":@0,
42 | @"vcName":@"YXViewPagerSub0ViewController"
43 | },
44 | @{
45 | @"itemType":@2,
46 | @"title":@"百科",
47 | @"normalTitleColor":@"#FFFFFF",
48 | @"selectTitleColor":@"#FFFFFF",
49 | @"normalIconName":@"icon_1_normal",
50 | @"selectIconName":@"icon_1_normal",\
51 | @"imageType":@0,
52 | @"vcName":@"YXViewPagerSub1ViewController"
53 | },
54 | @{
55 | @"itemType":@2,
56 | @"title":@"种草",
57 | @"normalTitleColor":@"#FFFFFF",
58 | @"selectTitleColor":@"#FFFFFF",
59 | @"normalIconName":@"icon_2_normal",
60 | @"selectIconName":@"icon_2_normal",
61 | @"imageType":@0,
62 | @"vcName":@"YXViewPagerSub2ViewController"
63 | },
64 | @{
65 | @"itemType":@2,
66 | @"title":@"海淘",
67 | @"normalTitleColor":@"#FFFFFF",
68 | @"selectTitleColor":@"#FFFFFF",
69 | @"normalIconName":@"icon_3_normal",
70 | @"selectIconName":@"icon_3_normal",
71 | @"imageType":@0,
72 | @"vcName":@"YXViewPagerSub3ViewController"
73 | },
74 | @{
75 | @"itemType":@2,
76 | @"title":@"我说好",
77 | @"normalTitleColor":@"#FFFFFF",
78 | @"selectTitleColor":@"#FFFFFF",
79 | @"normalIconName":@"icon_4_normal",
80 | @"selectIconName":@"icon_4_normal",
81 | @"imageType":@0,
82 | @"vcName":@"YXViewPagerSub4ViewController"
83 | }
84 | ]
85 | };
86 | return configInfo;
87 | }
88 |
89 | @end
90 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo2ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo2ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerDemo2ViewController : YXViewPagerBaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo2ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo2ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerDemo2ViewController.h"
10 |
11 | @interface YXViewPagerDemo2ViewController ()
12 |
13 | @end
14 |
15 | @implementation YXViewPagerDemo2ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | self.title = @"只有文字";
20 | [self renderUI];
21 | [self tabItemSelected:0 needAnimation:NO];
22 | }
23 |
24 | - (NSDictionary *)getPageConfigInfo{
25 | NSDictionary *configInfo = @{
26 | @"topViewBgColor":@"#282B31",
27 | @"maskColor":@"#269FE7",
28 | @"type":@0,
29 | @"items":@[@{
30 | @"itemType":@0,
31 | @"title":@"精选",
32 | @"normalTitleColor":@"#FFFFFF",
33 | @"selectTitleColor":@"#FFFFFF",
34 | @"vcName":@"YXViewPagerSub0ViewController"
35 | },
36 | @{
37 | @"itemType":@0,
38 | @"title":@"百科",
39 | @"normalTitleColor":@"#FFFFFF",
40 | @"selectTitleColor":@"#FFFFFF",
41 | @"vcName":@"YXViewPagerSub1ViewController"
42 | },
43 | @{
44 | @"itemType":@0,
45 | @"title":@"种草",
46 | @"normalTitleColor":@"#FFFFFF",
47 | @"selectTitleColor":@"#FFFFFF",
48 | @"vcName":@"YXViewPagerSub2ViewController"
49 | },
50 | @{
51 | @"itemType":@0,
52 | @"title":@"海淘",
53 | @"normalTitleColor":@"#FFFFFF",
54 | @"selectTitleColor":@"#FFFFFF",
55 | @"vcName":@"YXViewPagerSub3ViewController"
56 | },
57 | @{
58 | @"itemType":@0,
59 | @"title":@"我说好",
60 | @"normalTitleColor":@"#FFFFFF",
61 | @"selectTitleColor":@"#FFFFFF",
62 | @"vcName":@"YXViewPagerSub4ViewController"
63 | }
64 | ]
65 | };
66 | return configInfo;
67 | }
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo3ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo3ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerDemo3ViewController : YXViewPagerBaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo3ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo3ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerDemo3ViewController.h"
10 |
11 | @interface YXViewPagerDemo3ViewController ()
12 |
13 | @end
14 |
15 | @implementation YXViewPagerDemo3ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | self.title = @"只有图片";
20 | [self renderUI];
21 | [self tabItemSelected:0 needAnimation:NO];
22 | }
23 |
24 | - (NSDictionary *)getPageConfigInfo{
25 | NSDictionary *configInfo = @{
26 | @"topViewBgColor":@"#282B31",
27 | @"maskColor":@"#269FE7",
28 | @"type":@0,
29 | @"items":@[@{
30 | @"itemType":@1,
31 | @"normalIconName":@"icon_0_normal",
32 | @"selectIconName":@"icon_0_normal",
33 | @"vcName":@"YXViewPagerSub0ViewController"
34 | },
35 | @{
36 | @"itemType":@1,
37 | @"normalIconName":@"icon_1_normal",
38 | @"selectIconName":@"icon_1_normal",
39 | @"vcName":@"YXViewPagerSub1ViewController"
40 | },
41 | @{
42 | @"itemType":@1,
43 | @"normalIconName":@"icon_2_normal",
44 | @"selectIconName":@"icon_2_normal",
45 | @"vcName":@"YXViewPagerSub2ViewController"
46 | },
47 | @{
48 | @"itemType":@1,
49 | @"normalIconName":@"icon_3_normal",
50 | @"selectIconName":@"icon_3_normal",
51 | @"vcName":@"YXViewPagerSub3ViewController"
52 | },
53 | @{
54 | @"itemType":@1,
55 | @"normalIconName":@"icon_4_normal",
56 | @"selectIconName":@"icon_4_normal",
57 | @"vcName":@"YXViewPagerSub4ViewController"
58 | }
59 | ]
60 | };
61 | return configInfo;
62 | }
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo4ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo4ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerDemo4ViewController : YXViewPagerBaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo4ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo4ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerDemo4ViewController.h"
10 |
11 | @interface YXViewPagerDemo4ViewController ()
12 |
13 | @end
14 |
15 | @implementation YXViewPagerDemo4ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | self.title = @"图片+文字选中切换";
20 | [self renderUI];
21 | [self tabItemSelected:0 needAnimation:NO];
22 | }
23 |
24 | - (NSDictionary *)getPageConfigInfo{
25 | NSDictionary *configInfo = @{
26 | @"topViewBgColor":@"#FFFFFF",
27 | @"maskColor":@"#FEEDB1",
28 | @"type":@0,
29 | @"items":@[@{
30 | @"itemType":@2,
31 | @"title":@"推荐",
32 | @"normalTitleColor":@"#666666",
33 | @"selectTitleColor":@"#3d3d3d",
34 | @"normalIconName":@"home_unselect",
35 | @"selectIconName":@"home_select",
36 | @"vcName":@"YXViewPagerSub0ViewController"
37 | },
38 | @{
39 | @"itemType":@2,
40 | @"title":@"旅行机票",
41 | @"normalTitleColor":@"#666666",
42 | @"selectTitleColor":@"#3d3d3d",
43 | @"normalIconName":@"flight_unselect",
44 | @"selectIconName":@"flight_select",
45 | @"vcName":@"YXViewPagerSub1ViewController"
46 | },
47 | @{
48 | @"itemType":@2,
49 | @"title":@"签证",
50 | @"normalTitleColor":@"#666666",
51 | @"selectTitleColor":@"#3d3d3d",
52 | @"normalIconName":@"visa_unselect",
53 | @"selectIconName":@"visa_select",
54 | @"vcName":@"YXViewPagerSub2ViewController"
55 | },
56 | @{
57 | @"itemType":@2,
58 | @"title":@"酒店",
59 | @"normalTitleColor":@"#666666",
60 | @"selectTitleColor":@"#3d3d3d",
61 | @"normalIconName":@"hotel_unselect",
62 | @"selectIconName":@"hotel_select",
63 | @"vcName":@"YXViewPagerSub3ViewController"
64 | },
65 | @{
66 | @"itemType":@2,
67 | @"title":@"租车包车",
68 | @"normalTitleColor":@"#666666",
69 | @"selectTitleColor":@"#3d3d3d",
70 | @"normalIconName":@"car_unselect",
71 | @"selectIconName":@"car_select",
72 | @"vcName":@"YXViewPagerSub4ViewController"
73 | }
74 | ]
75 | };
76 | return configInfo;
77 | }
78 |
79 | @end
80 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo5ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo5ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerDemo5ViewController : YXViewPagerBaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo5ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo5ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerDemo5ViewController.h"
10 |
11 | @interface YXViewPagerDemo5ViewController ()
12 |
13 | @end
14 |
15 | @implementation YXViewPagerDemo5ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | self.title = @"超过一屏";
20 | [self renderUI];
21 | [self tabItemSelected:0 needAnimation:NO];
22 | }
23 |
24 | - (NSDictionary *)getPageConfigInfo{
25 | NSDictionary *configInfo = @{
26 | @"topViewBgColor":@"#FFFFFF",
27 | @"maskColor":@"#FEEDB1",
28 | @"type":@1,
29 | @"itemWidth":@60,
30 | @"maskWidth":@60,
31 | @"items":@[@{
32 | @"itemType":@2,
33 | @"title":@"推荐",
34 | @"normalTitleColor":@"#666666",
35 | @"selectTitleColor":@"#3d3d3d",
36 | @"normalIconName":@"home_unselect",
37 | @"selectIconName":@"home_select",
38 | @"vcName":@"YXViewPagerSub0ViewController"
39 | },
40 | @{
41 | @"itemType":@2,
42 | @"title":@"旅行机票",
43 | @"normalTitleColor":@"#666666",
44 | @"selectTitleColor":@"#3d3d3d",
45 | @"normalIconName":@"flight_unselect",
46 | @"selectIconName":@"flight_select",
47 | @"vcName":@"YXViewPagerSub1ViewController"
48 | },
49 | @{
50 | @"itemType":@2,
51 | @"title":@"签证",
52 | @"normalTitleColor":@"#666666",
53 | @"selectTitleColor":@"#3d3d3d",
54 | @"normalIconName":@"visa_unselect",
55 | @"selectIconName":@"visa_select",
56 | @"vcName":@"YXViewPagerSub2ViewController"
57 | },
58 | @{
59 | @"itemType":@2,
60 | @"title":@"酒店",
61 | @"normalTitleColor":@"#666666",
62 | @"selectTitleColor":@"#3d3d3d",
63 | @"normalIconName":@"hotel_unselect",
64 | @"selectIconName":@"hotel_select",
65 | @"vcName":@"YXViewPagerSub3ViewController"
66 | },
67 | @{
68 | @"itemType":@2,
69 | @"title":@"租车包车",
70 | @"normalTitleColor":@"#666666",
71 | @"selectTitleColor":@"#3d3d3d",
72 | @"normalIconName":@"car_unselect",
73 | @"selectIconName":@"car_select",
74 | @"vcName":@"YXViewPagerSub4ViewController"
75 | },
76 | @{
77 | @"itemType":@2,
78 | @"title":@"接送机",
79 | @"normalTitleColor":@"#666666",
80 | @"selectTitleColor":@"#3d3d3d",
81 | @"normalIconName":@"transfer_unselect",
82 | @"selectIconName":@"transfer_select",
83 | @"vcName":@"YXViewPagerSub5ViewController"
84 | },
85 | @{
86 | @"itemType":@2,
87 | @"title":@"WIFI电话卡",
88 | @"normalTitleColor":@"#666666",
89 | @"selectTitleColor":@"#3d3d3d",
90 | @"normalIconName":@"wifi_unselect",
91 | @"selectIconName":@"wifi_select",
92 | @"vcName":@"YXViewPagerSub6ViewController"
93 | },
94 | @{
95 | @"itemType":@2,
96 | @"title":@"门票",
97 | @"normalTitleColor":@"#666666",
98 | @"selectTitleColor":@"#3d3d3d",
99 | @"normalIconName":@"ticket_unselect",
100 | @"selectIconName":@"ticket_select",
101 | @"vcName":@"YXViewPagerSub7ViewController"
102 | },
103 | @{
104 | @"itemType":@2,
105 | @"title":@"当地玩乐",
106 | @"normalTitleColor":@"#666666",
107 | @"selectTitleColor":@"#3d3d3d",
108 | @"normalIconName":@"fun_unselect",
109 | @"selectIconName":@"fun_select",
110 | @"vcName":@"YXViewPagerSub8ViewController"
111 | }
112 | ]
113 | };
114 | return configInfo;
115 | }
116 |
117 | @end
118 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo6ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo6ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerDemo6ViewController : YXViewPagerBaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo6ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo6ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerDemo6ViewController.h"
10 |
11 | @interface YXViewPagerDemo6ViewController ()
12 |
13 | @end
14 |
15 | @implementation YXViewPagerDemo6ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | self.title = @"rootVC与subVC通信";
20 | self.rootToSubInfo = @{
21 | @"rootInfo":@"我是RootVC传递过来的参数"
22 | };
23 | [self renderUI];
24 | [self tabItemSelected:0 needAnimation:NO];
25 | }
26 |
27 | - (NSDictionary *)getPageConfigInfo{
28 | NSDictionary *configInfo = @{
29 | @"topViewBgColor":@"#FFFFFF",
30 | @"maskColor":@"#FEEDB1",
31 | @"type":@1,
32 | @"itemWidth":@60,
33 | @"maskWidth":@60,
34 | @"items":@[@{
35 | @"itemType":@2,
36 | @"title":@"推荐",
37 | @"normalTitleColor":@"#666666",
38 | @"selectTitleColor":@"#3d3d3d",
39 | @"normalIconName":@"home_unselect",
40 | @"selectIconName":@"home_select",
41 | @"vcName":@"YXViewPagerSub0ViewController"
42 | },
43 | @{
44 | @"itemType":@2,
45 | @"title":@"旅行机票",
46 | @"normalTitleColor":@"#666666",
47 | @"selectTitleColor":@"#3d3d3d",
48 | @"normalIconName":@"flight_unselect",
49 | @"selectIconName":@"flight_select",
50 | @"vcName":@"YXViewPagerSub1ViewController"
51 | },
52 | @{
53 | @"itemType":@2,
54 | @"title":@"签证",
55 | @"normalTitleColor":@"#666666",
56 | @"selectTitleColor":@"#3d3d3d",
57 | @"normalIconName":@"visa_unselect",
58 | @"selectIconName":@"visa_select",
59 | @"vcName":@"YXViewPagerSub2ViewController"
60 | },
61 | @{
62 | @"itemType":@2,
63 | @"title":@"酒店",
64 | @"normalTitleColor":@"#666666",
65 | @"selectTitleColor":@"#3d3d3d",
66 | @"normalIconName":@"hotel_unselect",
67 | @"selectIconName":@"hotel_select",
68 | @"vcName":@"YXViewPagerSub3ViewController"
69 | },
70 | @{
71 | @"itemType":@2,
72 | @"title":@"租车包车",
73 | @"normalTitleColor":@"#666666",
74 | @"selectTitleColor":@"#3d3d3d",
75 | @"normalIconName":@"car_unselect",
76 | @"selectIconName":@"car_select",
77 | @"vcName":@"YXViewPagerSub4ViewController"
78 | },
79 | @{
80 | @"itemType":@2,
81 | @"title":@"接送机",
82 | @"normalTitleColor":@"#666666",
83 | @"selectTitleColor":@"#3d3d3d",
84 | @"normalIconName":@"transfer_unselect",
85 | @"selectIconName":@"transfer_select",
86 | @"vcName":@"YXViewPagerSub5ViewController"
87 | },
88 | @{
89 | @"itemType":@2,
90 | @"title":@"WIFI电话卡",
91 | @"normalTitleColor":@"#666666",
92 | @"selectTitleColor":@"#3d3d3d",
93 | @"normalIconName":@"wifi_unselect",
94 | @"selectIconName":@"wifi_select",
95 | @"vcName":@"YXViewPagerSub6ViewController"
96 | },
97 | @{
98 | @"itemType":@2,
99 | @"title":@"门票",
100 | @"normalTitleColor":@"#666666",
101 | @"selectTitleColor":@"#3d3d3d",
102 | @"normalIconName":@"ticket_unselect",
103 | @"selectIconName":@"ticket_select",
104 | @"vcName":@"YXViewPagerSub7ViewController"
105 | },
106 | @{
107 | @"itemType":@2,
108 | @"title":@"当地玩乐",
109 | @"normalTitleColor":@"#666666",
110 | @"selectTitleColor":@"#3d3d3d",
111 | @"normalIconName":@"fun_unselect",
112 | @"selectIconName":@"fun_select",
113 | @"vcName":@"YXViewPagerSub8ViewController"
114 | }
115 | ]
116 | };
117 | return configInfo;
118 | }
119 |
120 | @end
121 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo7ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo7ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerDemo7ViewController : YXViewPagerBaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo7ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo7ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 17/3/29.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerDemo7ViewController.h"
10 |
11 | @interface YXViewPagerDemo7ViewController ()
12 |
13 | @end
14 |
15 | @implementation YXViewPagerDemo7ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | NSLog(@"Root viewDidLoad");
20 | self.title = @"rootVC与subVC通信";
21 | self.rootToSubInfo = @{
22 | @"rootInfo":@"我是RootVC传递过来的参数"
23 | };
24 | [self renderUI];
25 | [self tabItemSelected:0 needAnimation:NO];
26 | }
27 |
28 | - (void)viewWillAppear:(BOOL)animated{
29 | [super viewWillAppear:animated];
30 | NSLog(@"Root viewWillAppear");
31 | }
32 |
33 | - (void)viewDidAppear:(BOOL)animated{
34 | [super viewDidAppear:animated];
35 | NSLog(@"Root viewDidAppear");
36 | }
37 |
38 | - (void)viewWillDisappear:(BOOL)animated{
39 | [super viewWillDisappear:animated];
40 | NSLog(@"Root viewWillDisappear");
41 | }
42 |
43 | - (void)viewDidDisappear:(BOOL)animated{
44 | [super viewDidDisappear:animated];
45 | NSLog(@"Root viewDidDisappear");
46 | }
47 |
48 | - (void)dealloc{
49 | NSLog(@"Root dealloc");
50 | }
51 |
52 | - (NSDictionary *)getPageConfigInfo{
53 | NSDictionary *configInfo = @{
54 | @"topViewBgColor":@"#FFFFFF",
55 | @"maskColor":@"#FEEDB1",
56 | @"type":@1,
57 | @"itemWidth":@60,
58 | @"maskWidth":@60,
59 | @"items":@[@{
60 | @"itemType":@2,
61 | @"title":@"推荐",
62 | @"normalTitleColor":@"#666666",
63 | @"selectTitleColor":@"#3d3d3d",
64 | @"normalIconName":@"home_unselect",
65 | @"selectIconName":@"home_select",
66 | @"vcName":@"YXViewPagerSub0ViewController"
67 | },
68 | @{
69 | @"itemType":@2,
70 | @"title":@"旅行机票",
71 | @"normalTitleColor":@"#666666",
72 | @"selectTitleColor":@"#3d3d3d",
73 | @"normalIconName":@"flight_unselect",
74 | @"selectIconName":@"flight_select",
75 | @"vcName":@"YXViewPagerSub1ViewController"
76 | },
77 | @{
78 | @"itemType":@2,
79 | @"title":@"签证",
80 | @"normalTitleColor":@"#666666",
81 | @"selectTitleColor":@"#3d3d3d",
82 | @"normalIconName":@"visa_unselect",
83 | @"selectIconName":@"visa_select",
84 | @"vcName":@"YXViewPagerSub2ViewController"
85 | },
86 | @{
87 | @"itemType":@2,
88 | @"title":@"酒店",
89 | @"normalTitleColor":@"#666666",
90 | @"selectTitleColor":@"#3d3d3d",
91 | @"normalIconName":@"hotel_unselect",
92 | @"selectIconName":@"hotel_select",
93 | @"vcName":@"YXViewPagerSub3ViewController"
94 | },
95 | @{
96 | @"itemType":@2,
97 | @"title":@"租车包车",
98 | @"normalTitleColor":@"#666666",
99 | @"selectTitleColor":@"#3d3d3d",
100 | @"normalIconName":@"car_unselect",
101 | @"selectIconName":@"car_select",
102 | @"vcName":@"YXViewPagerSub4ViewController"
103 | },
104 | @{
105 | @"itemType":@2,
106 | @"title":@"接送机",
107 | @"normalTitleColor":@"#666666",
108 | @"selectTitleColor":@"#3d3d3d",
109 | @"normalIconName":@"transfer_unselect",
110 | @"selectIconName":@"transfer_select",
111 | @"vcName":@"YXViewPagerSub5ViewController"
112 | },
113 | @{
114 | @"itemType":@2,
115 | @"title":@"WIFI电话卡",
116 | @"normalTitleColor":@"#666666",
117 | @"selectTitleColor":@"#3d3d3d",
118 | @"normalIconName":@"wifi_unselect",
119 | @"selectIconName":@"wifi_select",
120 | @"vcName":@"YXViewPagerSub6ViewController"
121 | },
122 | @{
123 | @"itemType":@2,
124 | @"title":@"门票",
125 | @"normalTitleColor":@"#666666",
126 | @"selectTitleColor":@"#3d3d3d",
127 | @"normalIconName":@"ticket_unselect",
128 | @"selectIconName":@"ticket_select",
129 | @"vcName":@"YXViewPagerSub7ViewController"
130 | },
131 | @{
132 | @"itemType":@2,
133 | @"title":@"当地玩乐",
134 | @"normalTitleColor":@"#666666",
135 | @"selectTitleColor":@"#3d3d3d",
136 | @"normalIconName":@"fun_unselect",
137 | @"selectIconName":@"fun_select",
138 | @"vcName":@"YXViewPagerSub8ViewController"
139 | }
140 | ]
141 | };
142 | return configInfo;
143 | }
144 |
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo8ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo8ViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerDemo8ViewController : YXViewPagerBaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Demo/YXViewPagerDemo8ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDemo8ViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | // Copyright © 2017年 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewPagerDemo8ViewController.h"
10 |
11 | @interface YXViewPagerDemo8ViewController ()
12 |
13 | @end
14 |
15 | @implementation YXViewPagerDemo8ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | self.title = @"复杂遮罩";
20 | [self renderUI];
21 | [self tabItemSelected:0 needAnimation:NO];
22 | }
23 |
24 | - (NSDictionary *)getPageConfigInfo{
25 | NSDictionary *configInfo = @{
26 | @"topViewBgColor":@"#2A2A2A",
27 | @"maskColor":@"#FFC900",
28 | @"type":@1,
29 | @"itemWidth":@80,
30 | @"maskHeight":@3,
31 | @"maskPositionType":@2,
32 | @"maskWidth":@80,
33 | @"needSecondaryMask":@(YES),
34 | @"secondaryMaskColor":@"#FFFFFF",
35 | @"secondaryMaskColorAlpha":@(0.09),
36 | @"items":@[@{
37 | @"itemType":@2,
38 | @"title":@"推荐",
39 | @"normalTitleColor":@"#FFFFFF",
40 | @"selectTitleColor":@"#FFC900",
41 | @"imageType":@1,
42 | @"normalIconName":@"https://gw.alicdn.com/tfs/TB1ocN8RXXXXXbNXVXXXXXXXXXX-48-48.png",
43 | @"selectIconName":@"https://gw.alicdn.com/tfs/TB1iNJZRXXXXXa8aXXXXXXXXXXX-48-48.png",
44 | @"vcName":@"YXViewPagerSub0ViewController"
45 | },
46 | @{
47 | @"itemType":@2,
48 | @"title":@"轻奢假日",
49 | @"normalTitleColor":@"#FFFFFF",
50 | @"selectTitleColor":@"#FFC900",
51 | @"imageType":@1,
52 | @"normalIconName":@"https://gw.alicdn.com/tfs/TB1jFqnRXXXXXaNXpXXXXXXXXXX-48-48.png",
53 | @"selectIconName":@"https://gw.alicdn.com/tfs/TB1E.5iRXXXXXauXFXXXXXXXXXX-48-48.png",
54 | @"vcName":@"YXViewPagerSub1ViewController"
55 | },
56 | @{
57 | @"itemType":@2,
58 | @"title":@"走近自然",
59 | @"normalTitleColor":@"#FFFFFF",
60 | @"selectTitleColor":@"#FFC900",
61 | @"imageType":@1,
62 | @"normalIconName":@"https://gw.alicdn.com/tfs/TB12HCERXXXXXagXXXXXXXXXXXX-48-48.png",
63 | @"selectIconName":@"https://gw.alicdn.com/tfs/TB1c5hYRXXXXXbOaXXXXXXXXXXX-48-48.png",
64 | @"vcName":@"YXViewPagerSub2ViewController"
65 | },
66 | @{
67 | @"itemType":@2,
68 | @"title":@"酒店控",
69 | @"normalTitleColor":@"#FFFFFF",
70 | @"selectTitleColor":@"#FFC900",
71 | @"imageType":@1,
72 | @"normalIconName":@"https://gw.alicdn.com/tfs/TB1gpOARXXXXXcmXXXXXXXXXXXX-48-48.png",
73 | @"selectIconName":@"https://gw.alicdn.com/tfs/TB11aqeRXXXXXcaXFXXXXXXXXXX-48-48.png",
74 | @"vcName":@"YXViewPagerSub3ViewController"
75 | },
76 | @{
77 | @"itemType":@2,
78 | @"title":@"家庭亲子",
79 | @"normalTitleColor":@"#FFFFFF",
80 | @"selectTitleColor":@"#FFC900",
81 | @"imageType":@1,
82 | @"normalIconName":@"https://gw.alicdn.com/tfs/TB1IwioRXXXXXXtXVXXXXXXXXXX-48-48.png",
83 | @"selectIconName":@"https://gw.alicdn.com/tfs/TB12mCyRXXXXXctXFXXXXXXXXXX-48-48.png",
84 | @"vcName":@"YXViewPagerSub4ViewController"
85 | },
86 | @{
87 | @"itemType":@2,
88 | @"title":@"文化风情",
89 | @"normalTitleColor":@"#FFFFFF",
90 | @"selectTitleColor":@"#FFC900",
91 | @"imageType":@1,
92 | @"normalIconName":@"https://gw.alicdn.com/tfs/TB1bo0KRXXXXXbdapXXXXXXXXXX-48-48.png",
93 | @"selectIconName":@"https://gw.alicdn.com/tfs/TB1UF9nRXXXXXbzXpXXXXXXXXXX-48-48.png",
94 | @"vcName":@"YXViewPagerSub5ViewController"
95 | },
96 | @{
97 | @"itemType":@2,
98 | @"title":@"周边探索",
99 | @"normalTitleColor":@"#FFFFFF",
100 | @"selectTitleColor":@"#FFC900",
101 | @"imageType":@1,
102 | @"normalIconName":@"https://gw.alicdn.com/tfs/TB15JNMRXXXXXcrapXXXXXXXXXX-48-48.png",
103 | @"selectIconName":@"https://gw.alicdn.com/tfs/TB1_Ox5RXXXXXcCXVXXXXXXXXXX-48-48.png",
104 | @"vcName":@"YXViewPagerSub6ViewController"
105 | }
106 | ]
107 | };
108 | return configInfo;
109 | }
110 |
111 |
112 | @end
113 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | }
88 | ],
89 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/car_select.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "car_select@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/car_select.imageset/car_select@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/car_select.imageset/car_select@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/car_unselect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "car_unselect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/car_unselect.imageset/car_unselect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/car_unselect.imageset/car_unselect@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/flight_select.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "flight_select@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/flight_select.imageset/flight_select@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/flight_select.imageset/flight_select@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/flight_unselect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "flight_unselect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/flight_unselect.imageset/flight_unselect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/flight_unselect.imageset/flight_unselect@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/fun_select.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "fun_select@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/fun_select.imageset/fun_select@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/fun_select.imageset/fun_select@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/fun_unselect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "fun_unselect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/fun_unselect.imageset/fun_unselect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/fun_unselect.imageset/fun_unselect@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/girl0.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "girl0.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 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/girl0.imageset/girl0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/girl0.imageset/girl0.jpg
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/girl1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "girl1.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 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/girl1.imageset/girl1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/girl1.imageset/girl1.jpg
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/home_select.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "home_select@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/home_select.imageset/home_select@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/home_select.imageset/home_select@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/home_unselect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "home_unselect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/home_unselect.imageset/home_unselect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/home_unselect.imageset/home_unselect@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/hotel_select.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "hotel_select@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/hotel_select.imageset/hotel_select@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/hotel_select.imageset/hotel_select@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/hotel_unselect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "hotel_unselect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/hotel_unselect.imageset/hotel_unselect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/hotel_unselect.imageset/hotel_unselect@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_0_normal.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "icon_0_normal.png",
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 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_0_normal.imageset/icon_0_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/icon_0_normal.imageset/icon_0_normal.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_1_normal.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "icon_1_normal.png",
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 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_1_normal.imageset/icon_1_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/icon_1_normal.imageset/icon_1_normal.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_2_normal.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "icon_2_normal.png",
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 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_2_normal.imageset/icon_2_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/icon_2_normal.imageset/icon_2_normal.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_3_normal.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "icon_3_normal.png",
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 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_3_normal.imageset/icon_3_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/icon_3_normal.imageset/icon_3_normal.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_4_normal.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "icon_4_normal.png",
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 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/icon_4_normal.imageset/icon_4_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/icon_4_normal.imageset/icon_4_normal.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/ticket_select.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "ticket_select@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/ticket_select.imageset/ticket_select@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/ticket_select.imageset/ticket_select@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/ticket_unselect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "ticket_unselect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/ticket_unselect.imageset/ticket_unselect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/ticket_unselect.imageset/ticket_unselect@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/transfer_select.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "transfer_select@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/transfer_select.imageset/transfer_select@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/transfer_select.imageset/transfer_select@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/transfer_unselect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "transfer_unselect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/transfer_unselect.imageset/transfer_unselect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/transfer_unselect.imageset/transfer_unselect@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/visa_select.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "visa_select@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/visa_select.imageset/visa_select@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/visa_select.imageset/visa_select@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/visa_unselect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "visa_unselect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/visa_unselect.imageset/visa_unselect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/visa_unselect.imageset/visa_unselect@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/wifi_select.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "wifi_select@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/wifi_select.imageset/wifi_select@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/wifi_select.imageset/wifi_select@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/wifi_unselect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "wifi_unselect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/Images.xcassets/wifi_unselect.imageset/wifi_unselect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/Example/YXViewPager/Images.xcassets/wifi_unselect.imageset/wifi_unselect@2x.png
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/YXAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXAppDelegate.h
3 | // YXViewPager
4 | //
5 | // Created by yixiangboy on 03/29/2017.
6 | // Copyright (c) 2017 yixiangboy. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface YXAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/YXAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXAppDelegate.m
3 | // YXViewPager
4 | //
5 | // Created by yixiangboy on 03/29/2017.
6 | // Copyright (c) 2017 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXAppDelegate.h"
10 | #import "YXViewController.h"
11 |
12 | @implementation YXAppDelegate
13 |
14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
15 | {
16 | //创建window
17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
18 | self.window.backgroundColor = [UIColor whiteColor];
19 |
20 |
21 | UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:[[YXViewController alloc] init]];
22 | //navCtrl.preferredStatusBarStyle = UIStatusBarStyleDefault;
23 |
24 | self.window.rootViewController = navCtrl;
25 |
26 | //设置window为主窗口并显示出来
27 | [self.window makeKeyAndVisible];
28 | return YES;
29 | }
30 |
31 | - (void)applicationWillResignActive:(UIApplication *)application
32 | {
33 | // 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.
34 | // 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.
35 | }
36 |
37 | - (void)applicationDidEnterBackground:(UIApplication *)application
38 | {
39 | // 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.
40 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
41 | }
42 |
43 | - (void)applicationWillEnterForeground:(UIApplication *)application
44 | {
45 | // 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.
46 | }
47 |
48 | - (void)applicationDidBecomeActive:(UIApplication *)application
49 | {
50 | // 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.
51 | }
52 |
53 | - (void)applicationWillTerminate:(UIApplication *)application
54 | {
55 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/YXViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewController.h
3 | // YXViewPager
4 | //
5 | // Created by yixiangboy on 03/29/2017.
6 | // Copyright (c) 2017 yixiangboy. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface YXViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/YXViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewController.m
3 | // YXViewPager
4 | //
5 | // Created by yixiangboy on 03/29/2017.
6 | // Copyright (c) 2017 yixiangboy. All rights reserved.
7 | //
8 |
9 | #import "YXViewController.h"
10 | #import "YXViewPagerDemo1ViewController.h"
11 | #import "YXViewPagerDemo2ViewController.h"
12 | #import "YXViewPagerDemo3ViewController.h"
13 | #import "YXViewPagerDemo4ViewController.h"
14 | #import "YXViewPagerDemo5ViewController.h"
15 | #import "YXViewPagerDemo6ViewController.h"
16 | #import "YXViewPagerDemo7ViewController.h"
17 | #import "YXViewPagerDemo8ViewController.h"
18 |
19 | @interface YXViewController ()
20 |
21 | @property (nonatomic, strong) NSArray *items;
22 |
23 | @end
24 |
25 | @implementation YXViewController
26 |
27 | - (void)viewDidLoad
28 | {
29 | [super viewDidLoad];
30 | self.title = @"ViewPager";
31 | self.view.backgroundColor = [UIColor whiteColor];
32 |
33 | [self initTableView];
34 | }
35 |
36 | -(void)initData{
37 | _items = @[@"图片+文字",@"只有文字",@"只有图片",@"图片+文字选中切换",@"超过一屏",@"rootVC与subVC通信",@"生命周期探索",@"周边好去处"];
38 | }
39 |
40 | -(void)initTableView{
41 | [self initData];
42 | UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.frame];
43 | tableView.delegate = self;
44 | tableView.dataSource = self;
45 | [self.view addSubview:tableView];
46 | }
47 |
48 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
49 | return _items.count;
50 | }
51 |
52 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
53 | static NSString *cellId = @"cellId";
54 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
55 | if (!cell) {
56 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
57 | }
58 |
59 | cell.textLabel.text = _items[indexPath.row];
60 | return cell;
61 | }
62 |
63 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
64 | NSInteger row = indexPath.row;
65 | UIViewController *vc;
66 | if (row==0) {
67 | vc = [[YXViewPagerDemo1ViewController alloc] init];
68 | }else if(row==1) {
69 | vc = [[YXViewPagerDemo2ViewController alloc] init];
70 | }else if(row==2) {
71 | vc = [[YXViewPagerDemo3ViewController alloc] init];
72 | }else if(row==3) {
73 | vc = [[YXViewPagerDemo4ViewController alloc] init];
74 | }else if(row==4){
75 | vc = [[YXViewPagerDemo5ViewController alloc] init];
76 | }else if(row==5){
77 | vc = [[YXViewPagerDemo6ViewController alloc] init];
78 | }else if(row==6){
79 | vc = [[YXViewPagerDemo7ViewController alloc] init];
80 | }else if(row==7){
81 | vc = [[YXViewPagerDemo8ViewController alloc] init];
82 | }
83 | [self.navigationController pushViewController:vc animated:YES];
84 | }
85 |
86 | @end
87 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/YXViewPager-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/YXViewPager-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | @import UIKit;
15 | @import Foundation;
16 | #endif
17 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/YXViewPager/Example/YXViewPager/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // YXViewPager
4 | //
5 | // Created by yixiangboy on 03/29/2017.
6 | // Copyright (c) 2017 yixiangboy. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 | #import "YXAppDelegate.h"
11 |
12 | int main(int argc, char * argv[])
13 | {
14 | @autoreleasepool {
15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([YXAppDelegate class]));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/YXViewPager/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2017 yixiangboy
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 |
--------------------------------------------------------------------------------
/YXViewPager/README.md:
--------------------------------------------------------------------------------
1 | # YXViewPager
2 |
3 | [](https://travis-ci.org/yixiangboy/YXViewPager)
4 | [](http://cocoapods.org/pods/YXViewPager)
5 | [](http://cocoapods.org/pods/YXViewPager)
6 | [](http://cocoapods.org/pods/YXViewPager)
7 |
8 | ## Example
9 |
10 | To run the example project, clone the repo, and run `pod install` from the Example directory first.
11 |
12 | ## Requirements
13 |
14 | ## Installation
15 |
16 | YXViewPager is available through [CocoaPods](http://cocoapods.org). To install
17 | it, simply add the following line to your Podfile:
18 |
19 | ```ruby
20 | pod "YXViewPager"
21 | ```
22 |
23 | ## Author
24 |
25 | yixiangboy, yixiang.yx@alibaba-inc.com
26 |
27 | ## License
28 |
29 | YXViewPager is available under the MIT license. See the LICENSE file for more info.
30 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint YXViewPager.podspec' to ensure this is a
3 | # valid spec before submitting.
4 | #
5 | # Any lines starting with a # are optional, but their use is encouraged
6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
7 | #
8 |
9 | Pod::Spec.new do |s|
10 | s.name = 'YXViewPager'
11 | s.version = '0.0.1'
12 | s.summary = 'YXViewPager For iOS'
13 |
14 | # This description is used to generate tags and improve search results.
15 | # * Think: What does it do? Why did you write it? What is the focus?
16 | # * Try to keep it short, snappy and to the point.
17 | # * Write the description between the DESC delimiters below.
18 | # * Finally, don't worry about the indent, CocoaPods strips it!
19 |
20 | s.description = <<-DESC
21 | iOS中模仿android实现的ViewPager
22 | DESC
23 |
24 | s.homepage = 'https://github.com/yixiangboy/YXViewPager'
25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
26 | s.license = { :type => 'MIT', :file => 'LICENSE' }
27 | s.author = { 'yixiangboy' => 'javer_yi@163.com' }
28 | s.source = { :git => 'https://github.com/yixiangboy/YXViewPager.git', :tag => '0.0.1' }
29 | # s.social_media_url = 'https://twitter.com/'
30 |
31 | s.ios.deployment_target = '7.0'
32 |
33 | s.source_files = 'YXViewPager/YXViewPager/Classes/**/*'
34 |
35 | # s.resource_bundles = {
36 | # 'YXViewPager' => ['YXViewPager/Assets/*.png']
37 | # }
38 |
39 | # s.public_header_files = 'Pod/Classes/**/*.h'
40 | # s.frameworks = 'UIKit', 'MapKit'
41 | # s.dependency 'AFNetworking', '~> 2.3'
42 | end
43 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/YXViewPager/Assets/.gitkeep
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiangboy/YXViewPager/a7a22806c5bc3de4eed6189616df82f2ca2af653/YXViewPager/YXViewPager/Classes/.gitkeep
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Delegate/YXViewPagerEventDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerEventDelegate.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import
10 |
11 | @protocol YXViewPagerEventDelegate
12 |
13 | - (void)handleEventWithEventName:(NSString *)eventName context:(NSDictionary *)context;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Delegate/YXViewPagerSubVcScrollDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerSubVcScrollDelegate.h
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import
10 | #define OffsetDistanceV 0.3f;
11 | #define scrollThresholdOffsetUp 60.0f
12 | #define scrollThresholdOffsetDown 60.0f
13 |
14 | @protocol YXViewPagerSubVcScrollDelegate
15 |
16 | - (void)scrollViewWillBeginDraggingWithOffset:(CGFloat)offsetY;
17 |
18 | - (void)scrollViewDidScrollWithOffset:(CGFloat)offsetY;
19 |
20 | - (void)beginToPullRefresh;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Model/YXViewPagerConfigItemModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerConfigItemModel.h
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerConfigItemModel : NSObject
12 |
13 | /** 显示模式 0: 文本 1: 图片 2: 图文混排 */
14 | @property (nonatomic, strong) NSNumber *itemType;
15 |
16 | /** 标题 */
17 | @property (nonatomic, strong) NSString *title;
18 |
19 | /** 未选中标题颜色 */
20 | @property (nonatomic, strong) NSString *normalTitleColor;
21 |
22 | /** 选中标题颜色 */
23 | @property (nonatomic, strong) NSString *selectTitleColor;
24 |
25 | /** 未选中图标 */
26 | @property (nonatomic, strong) NSString *normalIconName;
27 |
28 | /** 选中图标 */
29 | @property (nonatomic, strong) NSString *selectIconName;
30 |
31 | /** 图片类型 0: 本地图片 1:网络图片*/
32 | @property (nonatomic, strong) NSNumber *imageType;
33 |
34 | /** 该item对应的ViewController的名称 */
35 | @property (nonatomic, strong) NSString *vcName;
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Model/YXViewPagerConfigItemModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerConfigItemModel.m
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import "YXViewPagerConfigItemModel.h"
10 |
11 | @implementation YXViewPagerConfigItemModel
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Model/YXViewPagerConfigModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerConfigModel.h
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import
10 | #import "YXViewPagerConfigItemModel.h"
11 |
12 | @interface YXViewPagerConfigModel : NSObject
13 |
14 | /** 背景色 */
15 | @property (nonatomic, strong) NSString *topViewBgColor;
16 |
17 | /** 第一遮罩颜色 */
18 | @property (nonatomic, strong) NSString *maskColor;
19 |
20 | /** 第一遮罩高度 默认和父类一样高*/
21 | @property (nonatomic, strong) NSNumber *maskHeight;
22 |
23 | /** 第一遮罩宽度 默认和父类一样宽*/
24 | @property (nonatomic, strong) NSNumber *maskWidth;
25 |
26 | /** 是否需要第二遮罩 */
27 | @property (nonatomic, strong) NSNumber *needSecondaryMask;
28 |
29 | /** 第二遮罩颜色 默认和父类一样宽高 可以继续扩展*/
30 | @property (nonatomic, strong) NSString *secondaryMaskColor;
31 |
32 | /** 第二遮罩层颜色的alpha值 */
33 | @property (nonatomic, strong) NSNumber *secondaryMaskColorAlpha;
34 |
35 | /** 遮罩位置 0:占据整个高度 1:顶部 2: 顶部 */
36 | @property (nonatomic, strong) NSNumber *maskPositionType;
37 |
38 | /** 显示类型 0:总宽度为屏幕宽度,不可滚动,每个item的宽度,根据item的个数确定。适合item数比较少的情况 1:每个item的宽度确定,超过屏幕可以滑动。适合item数比较多的情况 */
39 | @property (nonatomic, strong) NSNumber *type;
40 |
41 | /** 每一个item显示的宽度 */
42 | @property (nonatomic, strong) NSNumber *itemWidth;
43 |
44 | /** 每一个items的信息集合 */
45 | @property (nonatomic, strong) NSArray *items;
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Model/YXViewPagerConfigModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerConfigModel.m
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import "YXViewPagerConfigModel.h"
10 |
11 | @implementation YXViewPagerConfigModel
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Model/YXViewPagerItemViewModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerItemViewModel.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import
10 | #import
11 | @class YXViewPagerBaseSubViewController;
12 |
13 | typedef NS_ENUM(NSUInteger, YXViewPagerItemViewType) {
14 | YXViewPagerItemViewTypeForText = 0,
15 | YXViewPagerItemViewTypeForImage,
16 | YXViewPagerItemViewTypeForTextAndImage
17 | };
18 |
19 | typedef NS_ENUM(NSUInteger, TRIPYXViewPagerItemImageType) {
20 | YXViewPagerItemImageTypeForLocal = 0,//本地图片
21 | YXViewPagerItemImageTypeForUrl//网络图片
22 | };
23 |
24 | @interface YXViewPagerItemViewModel : NSObject
25 |
26 | @property (nonatomic, assign) YXViewPagerItemViewType itemType;
27 | @property (nonatomic, strong) NSString *title;
28 |
29 | @property (nonatomic, strong) NSString *normalTitleColor;//default #666666
30 | @property (nonatomic, strong) NSString *selectTitleColor;//default #3d3d3d
31 |
32 | @property (nonatomic, strong) NSString *normalIconName;//defult ic_element_tabbar_home_normal
33 | @property (nonatomic, strong) NSString *selectIconName;//defult ic_element_tabbar_home_pressed
34 |
35 | @property (nonatomic, assign) TRIPYXViewPagerItemImageType imageType;//图片类型
36 |
37 | @property (nonatomic, assign) BOOL hasShow;//该页面是否已经展示过
38 | @property (nonatomic, strong) NSString *vcName;//vc的名字
39 | @property (nonatomic, strong) YXViewPagerBaseSubViewController *vcInstance;//vc的实例
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Model/YXViewPagerItemViewModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerItemViewModel.m
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import "YXViewPagerItemViewModel.h"
10 |
11 | @implementation YXViewPagerItemViewModel
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/UIColor+YX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIColor+YX.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import
10 |
11 | @interface UIColor (YX)
12 |
13 | + (UIColor *)colorWithHexString:(NSString *)hexString;
14 |
15 | + (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/UIColor+YX.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIColor+YX.m
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import "UIColor+YX.h"
10 |
11 | @implementation UIColor (YX)
12 |
13 | + (UIColor *)colorWithHexString:(NSString *)hexString {
14 | return [UIColor colorWithHexString:hexString alpha:1.0];
15 | }
16 |
17 | + (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha {
18 | if ([hexString hasPrefix:@"0x"] || [hexString hasPrefix:@"0X"]) {
19 | hexString = [hexString substringFromIndex:2];
20 | } else if ([hexString hasPrefix:@"#"]) {
21 | hexString = [hexString substringFromIndex:1];
22 | }
23 |
24 | unsigned int value = 0;
25 | BOOL flag = [[NSScanner scannerWithString:hexString] scanHexInt:&value];
26 | if(NO == flag)
27 | return [UIColor clearColor];
28 | float r, g, b, a;
29 | a = alpha;
30 | b = value & 0x0000FF;
31 | value = value >> 8;
32 | g = value & 0x0000FF;
33 | value = value >> 8;
34 | r = value;
35 |
36 | return [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/UIImage+YX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+YX.h
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (YX)
12 |
13 | +(UIImage*)imageLoader:(NSString*)name;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/UIImage+YX.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+YX.m
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import "UIImage+YX.h"
10 |
11 | @implementation UIImage (YX)
12 |
13 | +(UIImage*)imageLoader:(NSString*)name
14 | {
15 | return [UIImage imageNamed:name];
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/UIImageView+YX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImageView+YX.h
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import
10 |
11 | @interface UIImageView (YX)
12 |
13 | - (void)setImageWithURL: (NSURL *)url completed:(void(^)(UIImage *image, NSError *error))block;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/UIImageView+YX.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImageView+YX.m
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import "UIImageView+YX.h"
10 |
11 | @implementation UIImageView (YX)
12 |
13 | - (void)setImageWithURL:(NSURL *)url completed:(void (^)(UIImage *image, NSError *error))block{
14 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
15 | NSData *data = [NSData dataWithContentsOfURL:url];
16 | UIImage *image = [UIImage imageWithData:data];
17 | dispatch_async(dispatch_get_main_queue(), ^{
18 | if (image) {
19 | self.image = image;
20 | block(image,nil);
21 | }else{
22 | block(nil,[NSError errorWithDomain:@"image_error" code:-1 userInfo:@{@"info":@"图片下载出错"}]);
23 | }
24 | });
25 |
26 | });
27 | }
28 |
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/UIView+YX.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+YX.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import
10 |
11 | @interface UIView (YX)
12 |
13 | @property CGFloat height;
14 | @property CGFloat width;
15 |
16 | @property CGFloat top;
17 | @property CGFloat left;
18 |
19 | @property CGFloat bottom;
20 | @property CGFloat right;
21 |
22 | @property CGPoint origin;
23 | @property CGSize size;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/UIView+YX.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+YX.m
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import "UIView+YX.h"
10 |
11 | @implementation UIView (YX)
12 |
13 | - (CGFloat) height
14 | {
15 | return self.frame.size.height;
16 | }
17 |
18 | - (void) setHeight: (CGFloat) newheight
19 | {
20 | CGRect newframe = self.frame;
21 | newframe.size.height = newheight;
22 | self.frame = newframe;
23 | }
24 |
25 | - (CGFloat) width
26 | {
27 | return self.frame.size.width;
28 | }
29 |
30 | - (void) setWidth: (CGFloat) newwidth
31 | {
32 | CGRect newframe = self.frame;
33 | newframe.size.width = newwidth;
34 | self.frame = newframe;
35 | }
36 |
37 | - (CGFloat) top
38 | {
39 | return self.frame.origin.y;
40 | }
41 |
42 | - (void) setTop: (CGFloat) newtop
43 | {
44 | CGRect newframe = self.frame;
45 | newframe.origin.y = newtop;
46 | self.frame = newframe;
47 | }
48 |
49 | - (CGFloat) left
50 | {
51 | return self.frame.origin.x;
52 | }
53 |
54 | - (void) setLeft: (CGFloat) newleft
55 | {
56 | CGRect newframe = self.frame;
57 | newframe.origin.x = newleft;
58 | self.frame = newframe;
59 | }
60 |
61 | - (CGFloat) bottom
62 | {
63 | return self.frame.origin.y + self.frame.size.height;
64 | }
65 |
66 | - (void) setBottom: (CGFloat) newbottom
67 | {
68 | CGRect newframe = self.frame;
69 | newframe.origin.y = newbottom - self.frame.size.height;
70 | self.frame = newframe;
71 | }
72 |
73 | - (CGFloat) right
74 | {
75 | return self.frame.origin.x + self.frame.size.width;
76 | }
77 |
78 | - (void) setRight: (CGFloat) newright
79 | {
80 | CGFloat delta = newright - (self.frame.origin.x + self.frame.size.width);
81 | CGRect newframe = self.frame;
82 | newframe.origin.x += delta ;
83 | self.frame = newframe;
84 | }
85 |
86 | - (CGPoint) origin
87 | {
88 | return self.frame.origin;
89 | }
90 |
91 | - (void) setOrigin: (CGPoint) aPoint
92 | {
93 | CGRect newframe = self.frame;
94 | newframe.origin = aPoint;
95 | self.frame = newframe;
96 | }
97 |
98 |
99 | // Retrieve and set the size
100 | - (CGSize) size
101 | {
102 | return self.frame.size;
103 | }
104 |
105 | - (void) setSize: (CGSize) aSize
106 | {
107 | CGRect newframe = self.frame;
108 | newframe.size = aSize;
109 | self.frame = newframe;
110 | }
111 |
112 |
113 | @end
114 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/YXViewPagerDefine.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerDefine.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #ifndef YXViewPagerDefine_h
10 | #define YXViewPagerDefine_h
11 |
12 | #define rm(view,x,y,width,height) view.frame = CGRectMake(x,y,width,height)
13 | #define STRING_IS_BLANK(str) (str==nil ||![str isKindOfClass:[NSString class]]|| [str length]<1)
14 | #define STRING_DEFAULT_BLANK(str) ((str==nil)?@"":str)
15 | #define STRING_DEFAULT_IF_BLANK(str,defaultStr) STRING_IS_BLANK(str) ? (defaultStr):str
16 | #define DICTIONARY_IS_EMPTY(dic) ((dic)==nil || ![(dic) isKindOfClass:[NSDictionary class]] || (dic).count < 1)
17 | #define ARRAY_IS_EMPTY(array) ((array)==nil || ![(array) isKindOfClass:[NSArray class]] || (array).count < 1)
18 |
19 | #define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
20 | #define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
21 | #define STATUSBAR_HEIGHT [UIApplication sharedApplication].statusBarFrame.size.height
22 |
23 | #endif /* YXViewPagerDefine_h */
24 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/Utility/YXViewPagerUtility.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerUtility.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #ifndef YXViewPagerUtility_h
10 | #define YXViewPagerUtility_h
11 |
12 | #import "YXViewPagerDefine.h"
13 | #import "UIView+YX.h"
14 | #import "UIColor+YX.h"
15 | #import "UIImage+YX.h"
16 | #import "UIImageView+YX.h"
17 |
18 | #define YXViewPagerHeight 51
19 |
20 | #endif /* YXViewPagerUtility_h */
21 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/VC/YXViewPagerBaseSubViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerBaseSubViewController.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import
10 | #import "YXViewPagerEventDelegate.h"
11 | #import "YXViewPagerSubVcScrollDelegate.h"
12 | @class YXViewPagerBaseViewController;
13 |
14 | @interface YXViewPagerBaseSubViewController : UIViewController
15 |
16 | /**
17 | RootVC向SubVC传递的消息参数
18 | */
19 | @property (nonatomic, strong) NSDictionary *rootToSubInfo;
20 |
21 | //RootVC类作为SubVC类的代理 处理一些需要子类传给父类的消息
22 | @property (nonatomic, weak) id delegate;
23 |
24 | //在SubVC类中获取rootVc,主要用于跳转
25 | @property (nonatomic, weak) YXViewPagerBaseViewController *rootVc;
26 |
27 | //SubVC的滚动事件,传递给RootVc的代理
28 | @property (nonatomic, weak) id scrollDelegate;
29 |
30 | @property (nonatomic, strong) UITableView *tableView;
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/VC/YXViewPagerBaseSubViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerBaseSubViewController.m
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import "YXViewPagerBaseSubViewController.h"
10 | #import "YXViewPagerUtility.h"
11 |
12 | @interface YXViewPagerBaseSubViewController ()
13 |
14 | @end
15 |
16 | @implementation YXViewPagerBaseSubViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | self.view.frame = CGRectMake(0, 0, self.view.width, self.view.height-64-YXViewPagerHeight);
21 | }
22 |
23 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView{
24 | if (scrollView.contentOffset.y <= 0){
25 | if ([self.scrollDelegate respondsToSelector:@selector(beginToPullRefresh)]){
26 | [self.scrollDelegate beginToPullRefresh];
27 | }
28 | }else {
29 | if ([self.scrollDelegate respondsToSelector:@selector(scrollViewDidScrollWithOffset:)]){
30 | [self.scrollDelegate scrollViewDidScrollWithOffset:scrollView.contentOffset.y];
31 | }
32 | }
33 | }
34 |
35 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
36 | if ([self.scrollDelegate respondsToSelector:@selector(scrollViewWillBeginDraggingWithOffset:)]){
37 | [self.scrollDelegate scrollViewWillBeginDraggingWithOffset:scrollView.contentOffset.y];
38 | }
39 | }
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/VC/YXViewPagerBaseViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerBaseViewController.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import
10 | @class YXViewPagerScrollView;
11 |
12 | @interface YXViewPagerBaseViewController : UIViewController
13 |
14 | @property (nonatomic, strong) NSDictionary *rootToSubInfo;
15 |
16 | @property (nonatomic, assign) NSInteger currentIndex;
17 |
18 | @property (nonatomic, strong) YXViewPagerScrollView *contentScroller;
19 |
20 | //页面框架容器View,如果需要添加子View的话, 添加到containerView上,不要添加到self.view上
21 | @property (nonatomic, strong) UIView *containerView;
22 |
23 | - (NSDictionary *)getPageConfigInfo;
24 |
25 |
26 | /**
27 | 第一次渲染UI
28 | */
29 | - (void)renderUI;
30 |
31 |
32 | /**
33 | 主动触发当前子页面setRootToSubInfo方法
34 | */
35 | - (void)sendRootToSubInfoToCurrentSubVc;
36 |
37 |
38 | /**
39 | 清除数据
40 | */
41 | - (void)clearData;
42 |
43 | /**
44 | 更新最新数据重新设置ViewPager
45 | */
46 | - (void)resetViewPager;
47 |
48 |
49 | /**
50 | 指定定位到某一个tab
51 |
52 | @param index
53 | */
54 | - (void)tabItemSelected:(NSInteger)index needAnimation:(BOOL)needAnimation;
55 |
56 | // 通知子类
57 | - (void)didSelectedItem:(NSInteger)index;
58 |
59 | //获取当前子类实例
60 | - (UIViewController*)getCurrentVCInstance;
61 |
62 | //是否需要沉浸式titleBar,子类需要重写该方案,决定是否需要该效果,默认开启
63 | - (BOOL)needMagicTitleBar;
64 |
65 | @end
66 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/View/YXViewPagerScrollView.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerScrollView.h
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import
10 |
11 | @interface YXViewPagerScrollView : UIScrollView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/View/YXViewPagerScrollView.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerScrollView.m
3 | // Pods
4 | //
5 | // Created by yixiang on 2017/7/4.
6 | //
7 | //
8 |
9 | #import "YXViewPagerScrollView.h"
10 |
11 | @implementation YXViewPagerScrollView
12 |
13 |
14 | /**
15 | 横向ScrollView支持系统左滑返回功能
16 |
17 | @param point
18 | @param event
19 | @return
20 | */
21 | - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{
22 | int pointIntX = (int)point.x;
23 | int viewWidth = (int)[UIScreen mainScreen].bounds.size.width;
24 | if (pointIntX % viewWidth < 10) {
25 | return NO;
26 | }
27 | return [super pointInside:point withEvent:event];
28 | }
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/View/YXViewPagerTopItemView.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerTopItemView.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import
10 | #import "YXViewPagerItemViewModel.h"
11 |
12 | typedef void (^YXViewPagerTopItemViewSelectCallBack)(NSInteger tag);
13 |
14 | @interface YXViewPagerTopItemView : UIView
15 |
16 | - (void)renderUIWithViewModel : (YXViewPagerItemViewModel *)viewModel;
17 |
18 | - (void)settingTabSelect:(BOOL)select;
19 |
20 | - (void)addSelectedCallBack:(YXViewPagerTopItemViewSelectCallBack)callback;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/View/YXViewPagerTopItemView.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerTopItemView.m
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import "YXViewPagerTopItemView.h"
10 | #import "YXViewPagerUtility.h"
11 |
12 | static CGFloat const kIconSize = 25.f;
13 | static CGFloat const kTitleSize = 11;
14 | static NSString *const kNormalTitleColor = @"#666666";
15 | static NSString *const kSelectTitleColor = @"#3d3d3d";
16 | static NSString *const kNormalIconName = @"ic_element_tabbar_home_normal";
17 | static NSString *const kSelectIconName = @"ic_element_tabbar_home_pressed";
18 |
19 | @interface YXViewPagerTopItemView()
20 |
21 | @property (nonatomic, strong) UIImageView *iconView;
22 | @property (nonatomic, strong) UILabel *titleLabel;
23 | @property (nonatomic, strong) YXViewPagerItemViewModel *viewModel;
24 | @property (nonatomic, copy) YXViewPagerTopItemViewSelectCallBack selectCallBack;
25 |
26 | @end
27 |
28 | @implementation YXViewPagerTopItemView
29 |
30 | - (instancetype)initWithFrame:(CGRect)frame{
31 | self = [super initWithFrame:frame];
32 | if (self) {
33 | _iconView = [[UIImageView alloc] init];
34 | [self addSubview:_iconView];
35 |
36 | _titleLabel = [[UILabel alloc] init];
37 | _titleLabel.font = [UIFont systemFontOfSize:kTitleSize];
38 | _titleLabel.textAlignment = NSTextAlignmentCenter;
39 | [self addSubview:_titleLabel];
40 |
41 | UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(itemClicked)];
42 | self.userInteractionEnabled = YES;
43 | [self addGestureRecognizer:gesture];
44 |
45 | }
46 | return self;
47 | }
48 |
49 | - (void)renderUIWithViewModel:(YXViewPagerItemViewModel *)viewModel{
50 | _viewModel = viewModel;
51 | YXViewPagerItemViewType itemType = viewModel.itemType;
52 | switch (itemType) {
53 | case YXViewPagerItemViewTypeForText:
54 | [self renderTextType:viewModel];
55 | break;
56 | case YXViewPagerItemViewTypeForImage:
57 | [self renderImageType:viewModel];
58 | break;
59 | case YXViewPagerItemViewTypeForTextAndImage:
60 | [self renderTextAndImageType:viewModel];
61 | break;
62 | default:
63 | break;
64 | }
65 | }
66 |
67 | - (void)settingTabSelect:(BOOL)select{
68 | YXViewPagerItemViewType itemType = _viewModel.itemType;
69 | switch (itemType) {
70 | case YXViewPagerItemViewTypeForText:
71 | if (select) {
72 | [self settingTitleColor:_viewModel.selectTitleColor];
73 | }else{
74 | [self settingTitleColor:_viewModel.normalTitleColor];
75 | }
76 | break;
77 | case YXViewPagerItemViewTypeForImage:
78 | if (select) {
79 | [self settingIconType:_viewModel.imageType iconName:_viewModel.selectIconName selected:YES];
80 | }else{
81 | [self settingIconType:_viewModel.imageType iconName:_viewModel.normalIconName selected:NO];
82 | }
83 | break;
84 | case YXViewPagerItemViewTypeForTextAndImage:
85 | if (select) {
86 | [self settingTitleColor:_viewModel.selectTitleColor];
87 | [self settingIconType:_viewModel.imageType iconName:_viewModel.selectIconName selected:YES];
88 | }else{
89 | [self settingTitleColor:_viewModel.normalTitleColor];
90 | [self settingIconType:_viewModel.imageType iconName:_viewModel.normalIconName selected:NO];
91 | }
92 | break;
93 | default:
94 | break;
95 | }
96 | }
97 |
98 | - (void)renderTextType:(YXViewPagerItemViewModel *)viewModel{
99 | _titleLabel.frame = self.bounds;
100 | _titleLabel.text = viewModel.title;
101 | [self settingTitleColor:viewModel.normalTitleColor];
102 | }
103 |
104 | - (void)renderImageType:(YXViewPagerItemViewModel *)viewModel{
105 | _iconView.frame = CGRectMake(self.width/2-kIconSize/2, self.height/2-kIconSize/2, kIconSize, kIconSize);
106 | [self settingIconType:viewModel.imageType iconName:viewModel.normalIconName selected:NO];
107 | }
108 |
109 |
110 | - (void)renderTextAndImageType:(YXViewPagerItemViewModel *)viewModel{
111 | _iconView.frame = CGRectMake(self.width/2-kIconSize/2, 5., kIconSize, kIconSize);
112 | [self settingIconType:viewModel.imageType iconName:viewModel.normalIconName selected:NO];
113 |
114 | _titleLabel.frame = CGRectMake(0, self.height-9.5-kTitleSize, self.width, kTitleSize);
115 | _titleLabel.text = viewModel.title;
116 | [self settingTitleColor:viewModel.normalTitleColor];
117 | }
118 |
119 |
120 | /**
121 | 设置图标
122 |
123 | @param iconName
124 | */
125 | - (void)settingIconType:(TRIPYXViewPagerItemImageType)imageType iconName:(NSString *)iconName selected:(BOOL)selected{
126 | if (imageType == YXViewPagerItemImageTypeForLocal) {
127 | if (STRING_IS_BLANK(iconName)) {
128 | _iconView.image = [UIImage imageLoader:kNormalIconName];
129 | }else{
130 | _iconView.image = [UIImage imageLoader:iconName];
131 | }
132 | }else if(imageType == YXViewPagerItemImageTypeForUrl){
133 | if (!STRING_IS_BLANK(iconName)) {
134 | [self setImageFromUrlWithIconUrl:iconName selected:selected];
135 | }else{
136 | if (selected) {
137 | _iconView.image = [UIImage imageLoader:@"trip_viewpager_item_selected"];
138 | }else{
139 | _iconView.image = [UIImage imageLoader:@"trip_viewpager_item_unselected"];
140 | }
141 | }
142 | }
143 | }
144 |
145 | //没有网络的情况下,需要默认图。使用placeholder会有闪动感觉
146 | - (void)setImageFromUrlWithIconUrl: (NSString *)iconUrl selected : (BOOL)selected{
147 | NSURL *iconURL = [NSURL URLWithString:iconUrl];
148 | if (iconURL) {
149 | __weak typeof(self) weakSelf = self;
150 | [_iconView setImageWithURL:[NSURL URLWithString:iconUrl] completed:^(UIImage *image, NSError *error) {
151 | if (error) {
152 | if (selected) {
153 | weakSelf.iconView.image = [UIImage imageLoader:@"trip_viewpager_item_selected"];
154 | }else{
155 | weakSelf.iconView.image = [UIImage imageLoader:@"trip_viewpager_item_unselected"];
156 | }
157 | }
158 | }];
159 | }
160 | }
161 |
162 |
163 | /**
164 | 设置文本颜色
165 |
166 | @param titleColor
167 | */
168 | - (void)settingTitleColor:(NSString *)titleColor{
169 | if (STRING_IS_BLANK(titleColor)) {
170 | _titleLabel.textColor = [UIColor colorWithHexString:kNormalTitleColor];
171 | }else{
172 | _titleLabel.textColor = [UIColor colorWithHexString:titleColor];
173 | }
174 | }
175 |
176 | - (void)addSelectedCallBack:(YXViewPagerTopItemViewSelectCallBack)callback{
177 | _selectCallBack = callback;
178 | }
179 |
180 | - (void)itemClicked{
181 | if (_selectCallBack) {
182 | _selectCallBack(self.tag);
183 | }
184 | }
185 |
186 | @end
187 |
188 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/View/YXViewPagerTopView.h:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerTopView.h
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, YXViewPagerTopViewType) {
12 | YXViewPagerTopViewTypeForNoScroll = 0,//default 总宽度为屏幕宽度,不可滚动,每个item的宽度,根据item的个数确定。适合item数比较少的情况
13 | YXViewPagerTopViewTypeForCanScroll//每个item的宽度确定,超过屏幕可以滑动。适合item数比较多的情况。
14 | };
15 |
16 | typedef NS_ENUM(NSUInteger, YXViewPagerMaskViewPositionType) {
17 | YXViewPagerMaskViewPositionTypeForNone = 0,//maskView占据整个高度
18 | YXViewPagerMaskViewPositionTypeForTop,//maskView的位置 顶部
19 | YXViewPagerMaskViewPositionTypeForBottom//maskView的位置 底部
20 | };
21 |
22 | typedef void (^YXViewPagerTopViewScrollViewBlock)(UIScrollView *scrollView);
23 | typedef void (^YXViewPagerTopViewItemClickBlock)(NSInteger tag);
24 |
25 | @interface YXViewPagerTopView : UIView
26 |
27 |
28 | @property (nonatomic, assign) YXViewPagerTopViewType type;//default YXCommonUITabsTopViewTypeForNoScroll
29 | @property (nonatomic, assign) CGFloat itemWidth;//如果type==YXCommonUITabsTopViewTypeForCanScroll,需要指定宽度
30 | @property (nonatomic, strong) NSString *maskColor;//遮罩层的颜色 default@"#FFEEAE"
31 | @property (nonatomic, assign) CGFloat maskHeight;//遮罩层高度 default = topView的高度
32 | @property (nonatomic, assign) CGFloat maskWidth;//遮罩层宽度
33 | @property (nonatomic, assign) BOOL needSecondaryMask;//是否需要第二遮罩
34 | @property (nonatomic, strong) NSString *secondaryMaskColor;//第二遮罩颜色
35 | @property (nonatomic, assign) CGFloat secondaryMaskColorAlpha;//第二遮罩透明度
36 | @property (nonatomic, assign) YXViewPagerMaskViewPositionType maskPositionType;//遮罩的位置
37 |
38 | @property (nonatomic, strong) UIScrollView *tabScroller;
39 | @property (nonatomic, strong) UIView *maskView;
40 |
41 | - (void)renderUIWithArray : (NSArray *)dataArray;
42 |
43 | - (void)tabItemSelected:(NSInteger)index;
44 |
45 | - (void)addScrollViewBlock : (YXViewPagerTopViewScrollViewBlock) block;
46 |
47 | - (void)addItemClickBlock : (YXViewPagerTopViewItemClickBlock) block;
48 |
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/YXViewPager/YXViewPager/Classes/View/YXViewPagerTopView.m:
--------------------------------------------------------------------------------
1 | //
2 | // YXViewPagerTopView.m
3 | // Pods
4 | //
5 | // Created by yixiang on 17/3/29.
6 | //
7 | //
8 |
9 | #import "YXViewPagerTopView.h"
10 | #import "YXViewPagerUtility.h"
11 | #import "YXViewpagerItemViewModel.h"
12 | #import "YXViewPagerTopItemView.h"
13 |
14 | @interface YXViewPagerTopView()
15 |
16 | @property (nonatomic, strong) NSMutableArray *tabViews;
17 | @property (nonatomic, assign) NSInteger currentIndex;
18 | @property (nonatomic, copy) YXViewPagerTopViewScrollViewBlock scrollViewBlock;
19 | @property (nonatomic, copy) YXViewPagerTopViewItemClickBlock itemClickBlock;
20 | /** maskView显示颜色的Layer */
21 | @property (nonatomic, strong) CALayer *maskLayer;
22 | /** maskView显示颜色的Layer2 */
23 | @property (nonatomic, strong) CALayer *secondaryMaskLayer;
24 |
25 | @end
26 |
27 | @implementation YXViewPagerTopView
28 |
29 | - (instancetype)initWithFrame:(CGRect)frame{
30 | self = [super initWithFrame:frame];
31 | if (self) {
32 | [self initMaskView];
33 | [self initTabScroller];
34 | }
35 | return self;
36 | }
37 |
38 | - (void)initMaskView{
39 | _maskView = [[UIView alloc] initWithFrame:CGRectZero];
40 | _maskView.backgroundColor = [UIColor clearColor];
41 | _secondaryMaskLayer = [CALayer layer];
42 | _secondaryMaskLayer.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF" alpha:0.1].CGColor;
43 | [_maskView.layer addSublayer:_secondaryMaskLayer];
44 | _maskLayer = [CALayer layer];
45 | _maskLayer.backgroundColor = [UIColor colorWithHexString:@"#FFEEAE"].CGColor;
46 | [_maskView.layer addSublayer:_maskLayer];
47 | [self addSubview:_maskView];
48 | }
49 |
50 | - (void)initTabScroller{
51 | _tabScroller = [[UIScrollView alloc] initWithFrame:self.bounds];
52 | _tabScroller.showsHorizontalScrollIndicator = NO;
53 | _tabScroller.backgroundColor = [UIColor clearColor];
54 | _tabScroller.bounces = YES;
55 | _tabScroller.delegate = self;
56 | [self addSubview:_tabScroller];
57 | }
58 |
59 | - (void)setMaskColor:(NSString *)maskColor{
60 | _maskColor = maskColor;
61 | _maskLayer.backgroundColor = [UIColor colorWithHexString:maskColor].CGColor;
62 | }
63 |
64 | - (void)renderUIWithArray:(NSArray *)dataArray{
65 | if (ARRAY_IS_EMPTY(dataArray)) return;
66 |
67 | CGFloat offsetX = 0;
68 | [self handleItemWidthWithItemCount:dataArray.count];
69 | _maskView.frame = CGRectMake(0, 0, _itemWidth, self.height);
70 | if (_needSecondaryMask) {
71 | _secondaryMaskLayer.frame = _maskView.bounds;
72 | _secondaryMaskLayer.backgroundColor = [UIColor colorWithHexString:_secondaryMaskColor alpha:_secondaryMaskColorAlpha].CGColor;
73 | }else{
74 | [_secondaryMaskLayer removeFromSuperlayer];
75 | }
76 |
77 | if (_maskWidth>1) {
78 | if (_maskPositionType == YXViewPagerMaskViewPositionTypeForNone) {
79 | _maskLayer.frame = CGRectMake(_maskView.width/2-_maskWidth/2, 0, _maskWidth, _maskView.height);
80 | }else if(_maskPositionType == YXViewPagerMaskViewPositionTypeForTop) {
81 | _maskLayer.frame = CGRectMake(0, 0, _itemWidth, _maskHeight);
82 | }else if(_maskPositionType == YXViewPagerMaskViewPositionTypeForBottom) {
83 | _maskLayer.frame = CGRectMake(0, self.height-_maskHeight, _itemWidth, _maskHeight);
84 | }
85 | }
86 | _tabViews = [[NSMutableArray alloc] init];
87 | for (int i=0; i
13 | #import
14 | #import "YXViewPagerUtility.h"
15 |
16 | #endif /* YXViewPager_h */
17 |
--------------------------------------------------------------------------------
/YXViewPager/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------