├── .gitignore ├── LICENSE ├── README.md ├── Resource └── App Icon │ ├── Icon-40.png │ ├── Icon-40@2x.png │ ├── Icon-60@2x.png │ ├── Icon-60@3x.png │ ├── Icon-76.png │ ├── Icon-76@2x.png │ ├── Icon-Small.png │ ├── Icon-Small@2x.png │ └── Icon-Small@3x.png ├── YXTPageView.png ├── YXTPageView.podspec ├── YXTPageView.xcf ├── YXTPageView ├── YXTMainPageVC.h ├── YXTMainPageVC.m ├── YXTSubPageTVC.h ├── YXTSubPageTVC.m ├── YXTToolbarVC.h ├── YXTToolbarVC.m └── YXTToolbarVC.xib ├── YXTPageViewDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── YXTPageViewDemo.xccheckout │ └── xcuserdata │ │ └── hanton.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings └── xcuserdata │ └── hanton.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── YXTPageViewDemo.xcscheme │ └── xcschememanagement.plist ├── YXTPageViewDemo ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── LaunchScreen.xib ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-40.png │ │ ├── Icon-40@2x-1.png │ │ ├── Icon-40@2x.png │ │ ├── Icon-60@2x-1.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x-1.png │ │ ├── Icon-Small@2x.png │ │ └── Icon-Small@3x.png │ ├── Left.imageset │ │ ├── 062.png │ │ └── Contents.json │ ├── Main.imageset │ │ ├── 025.png │ │ └── Contents.json │ ├── Right.imageset │ │ ├── 063.png │ │ └── Contents.json │ └── img_background.imageset │ │ ├── Contents.json │ │ ├── img_background@2x.png │ │ └── img_background@3x.png ├── Info.plist ├── MainPage.xib ├── MainPageVC.h ├── MainPageVC.m ├── SubPageCell.h ├── SubPageCell.m ├── SubPageCell.xib ├── SubPageTVC.h ├── SubPageTVC.m └── main.m ├── YXTPageViewDemoTests ├── Info.plist └── YXTPageViewDemoTests.m └── screenshots ├── YXTPageView.gif └── YXTPageView.mov /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | 20 | # Pods - for those of you who use CocoaPods 21 | Pods 22 | 23 | # Common 24 | Common 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) [2015] [Hanton Yang] 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YXTPageView 2 | ##A Page View, which support scrolling to transition between a UIView and a UITableView 3 | 4 | UIView (at the top) 5 | 6 | + 7 | 8 | UITableView (at the bottom) 9 | 10 | Installation 11 | ----- 12 | 13 | **CocoaPods** 14 | 15 | * Add the dependency to your Podfile: 16 | ```ruby 17 | platform :ios 18 | pod 'YXTPageView' 19 | ... 20 | ``` 21 | 22 | * Run `pod install` to install the dependencies. 23 | 24 | **Source files** 25 | 26 | Just clone this repository or download it in zip-file. Then you will find source files under **YXTPageView** directory. Copy them to your project. 27 | 28 | Usage 29 | ----- 30 | See the demo project. 31 | 32 | Screenshot 33 | ---------- 34 | 35 | ![screenshot](https://github.com/hanton/YXTPageView/raw/master/screenshots/YXTPageView.gif) 36 | 37 | Requirements 38 | ---------- 39 | * iOS 7.0+ 40 | * ARC 41 | 42 | Contributing 43 | ---------- 44 | Anyone who would like to contribute to the project is more than welcome. 45 | 46 | * Fork this repo 47 | * Make your changes 48 | * Submit pull request 49 | 50 | ## License 51 | YXTMotionView is released under the MIT license. 52 | 53 | Contact 54 | ---------- 55 | Hanton Yang (hanton.yang@gmail.com) 56 | -------------------------------------------------------------------------------- /Resource/App Icon/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/Resource/App Icon/Icon-40.png -------------------------------------------------------------------------------- /Resource/App Icon/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/Resource/App Icon/Icon-40@2x.png -------------------------------------------------------------------------------- /Resource/App Icon/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/Resource/App Icon/Icon-60@2x.png -------------------------------------------------------------------------------- /Resource/App Icon/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/Resource/App Icon/Icon-60@3x.png -------------------------------------------------------------------------------- /Resource/App Icon/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/Resource/App Icon/Icon-76.png -------------------------------------------------------------------------------- /Resource/App Icon/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/Resource/App Icon/Icon-76@2x.png -------------------------------------------------------------------------------- /Resource/App Icon/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/Resource/App Icon/Icon-Small.png -------------------------------------------------------------------------------- /Resource/App Icon/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/Resource/App Icon/Icon-Small@2x.png -------------------------------------------------------------------------------- /Resource/App Icon/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/Resource/App Icon/Icon-Small@3x.png -------------------------------------------------------------------------------- /YXTPageView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageView.png -------------------------------------------------------------------------------- /YXTPageView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint YXTPageView.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "YXTPageView" 19 | s.version = "0.2.0" 20 | s.summary = "Scrolling to transition between a UIView and a UITableView." 21 | 22 | s.description = <<-DESC 23 | A Page View, which support scrolling to transition between a UIView and a UITableView. 24 | DESC 25 | 26 | s.homepage = "https://github.com/hanton/YXTPageView" 27 | # s.screenshots = "https://github.com/hanton/YXTPageView/blob/master/screenshots/YXTPageView.gif" 28 | 29 | 30 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 31 | # 32 | # Licensing your code is important. See http://choosealicense.com for more info. 33 | # CocoaPods will detect a license file if there is a named LICENSE* 34 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 35 | # 36 | 37 | # s.license = "MIT (example)" 38 | s.license = { :type => "MIT", :file => "LICENSE" } 39 | 40 | 41 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 42 | # 43 | # Specify the authors of the library, with email addresses. Email addresses 44 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 45 | # accepts just a name if you'd rather not provide an email address. 46 | # 47 | # Specify a social_media_url where others can refer to, for example a twitter 48 | # profile URL. 49 | # 50 | 51 | s.author = { "Hanton" => "hanton.yang@gmail.com" } 52 | # Or just: s.author = "Hanton" 53 | # s.authors = { "Hanton" => "hanton.yang@gmail.com" } 54 | # s.social_media_url = "http://twitter.com/Hanton" 55 | 56 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 57 | # 58 | # If this Pod runs only on iOS or OS X, then specify the platform and 59 | # the deployment target. You can optionally include the target after the platform. 60 | # 61 | 62 | s.platform = :ios 63 | # s.platform = :ios, "5.0" 64 | 65 | # When using multiple platforms 66 | s.ios.deployment_target = "7.0" 67 | # s.osx.deployment_target = "10.7" 68 | 69 | 70 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 71 | # 72 | # Specify the location from where the source should be retrieved. 73 | # Supports git, hg, bzr, svn and HTTP. 74 | # 75 | 76 | s.source = { :git => "https://github.com/hanton/YXTPageView.git", :tag => "#{s.version}"} 77 | 78 | 79 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 80 | # 81 | # CocoaPods is smart about how it includes source code. For source files 82 | # giving a folder will include any swift, h, m, mm, c & cpp files. 83 | # For header files it will include any header in the folder. 84 | # Not including the public_header_files will make all headers public. 85 | # 86 | 87 | s.source_files = "YXTPageView", "YXTPageView/**/*.{h,m,xib}" 88 | # s.exclude_files = "Classes/Exclude" 89 | 90 | # s.public_header_files = "Classes/**/*.h" 91 | 92 | 93 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 94 | # 95 | # A list of resources included with the Pod. These are copied into the 96 | # target bundle with a build phase script. Anything else will be cleaned. 97 | # You can preserve files from being cleaned, please don't preserve 98 | # non-essential files like tests, examples and documentation. 99 | # 100 | 101 | # s.resource = "icon.png" 102 | # s.resources = "Resources/*.png" 103 | 104 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 105 | 106 | 107 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 108 | # 109 | # Link your library with frameworks, or libraries. Libraries do not include 110 | # the lib prefix of their name. 111 | # 112 | 113 | # s.framework = "SomeFramework" 114 | # s.frameworks = "SomeFramework", "AnotherFramework" 115 | 116 | # s.library = "iconv" 117 | # s.libraries = "iconv", "xml2" 118 | 119 | 120 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 121 | # 122 | # If your library depends on compiler flags you can set them in the xcconfig hash 123 | # where they will only apply to your library. If you depend on other Podspecs 124 | # you can include multiple dependencies to ensure it works. 125 | 126 | s.requires_arc = true 127 | 128 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 129 | # s.dependency "JSONKit", "~> 1.4" 130 | 131 | end 132 | -------------------------------------------------------------------------------- /YXTPageView.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageView.xcf -------------------------------------------------------------------------------- /YXTPageView/YXTMainPageVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YXTHotelVC.h 3 | // HotelVIP 4 | // 5 | // Created by Hanton on 5/27/15. 6 | // Copyright (c) 2015 ZKJS. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YXTSubPageTVC.h" 11 | #import "YXTToolbarVC.h" 12 | 13 | @interface YXTMainPageVC : UIViewController 14 | @property(nonatomic, strong) YXTToolbarVC *toolbarVC; 15 | @property(nonatomic, strong) YXTSubPageTVC *subTableViewController; 16 | @property(nonatomic, strong) UIScrollView *scrollView; 17 | @property(nonatomic, strong) UIButton *mainButton; 18 | @end 19 | -------------------------------------------------------------------------------- /YXTPageView/YXTMainPageVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // YXTHotelVC.m 3 | // HotelVIP 4 | // 5 | // Created by Hanton on 5/27/15. 6 | // Copyright (c) 2015 ZKJS. All rights reserved. 7 | // 8 | 9 | #import "YXTMainPageVC.h" 10 | 11 | static const CGFloat YXTPullUpThreshold = 50.0; 12 | 13 | @interface YXTMainPageVC () 14 | @property (nonatomic) BOOL isDragging; 15 | @end 16 | 17 | @implementation YXTMainPageVC 18 | 19 | #pragma mark - View Lifecycle 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | self.isDragging = NO; 25 | 26 | [self addScrollView]; 27 | [self addToolbar]; 28 | [self addMainButton]; 29 | } 30 | 31 | - (void)viewDidAppear:(BOOL)animated 32 | { 33 | [super viewDidAppear:animated]; 34 | 35 | [self addSubPage]; 36 | } 37 | 38 | #pragma mark - Setup Subviews 39 | 40 | - (void)addScrollView { 41 | self.scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds]; 42 | self.scrollView.contentSize = CGSizeMake(CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds) + 0.3); 43 | self.scrollView.delegate = self; 44 | self.scrollView.backgroundColor = [UIColor whiteColor]; 45 | [self.view addSubview:self.scrollView]; 46 | } 47 | 48 | - (void)addToolbar { 49 | self.toolbarVC = [YXTToolbarVC new]; 50 | self.toolbarVC.view.frame = CGRectMake(0.0, CGRectGetHeight(self.view.frame) - CGRectGetHeight(self.toolbarVC.view.frame), CGRectGetWidth(self.view.frame), CGRectGetHeight(self.toolbarVC.view.frame)); 51 | self.toolbarVC.delegate = self; 52 | self.toolbarVC.view.alpha = 1.0; 53 | [self.view addSubview:self.toolbarVC.view]; 54 | } 55 | 56 | - (void)addSubPage { 57 | if (!self.subTableViewController) { 58 | return; 59 | } 60 | 61 | self.subTableViewController.mainViewController = self; 62 | self.subTableViewController.tableView.frame = CGRectMake(0, CGRectGetHeight(self.view.frame), CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)); 63 | self.subTableViewController.delegate = self; 64 | [self.scrollView addSubview:self.subTableViewController.tableView]; 65 | } 66 | 67 | - (void)addMainButton { 68 | self.mainButton = [UIButton buttonWithType:UIButtonTypeCustom]; 69 | [self.mainButton addTarget:self 70 | action:@selector(didPressedMainButton) 71 | forControlEvents:UIControlEventTouchUpInside]; 72 | // [self.mainButton setBackgroundColor:[UIColor grayColor]]; 73 | [self.mainButton setImage:[UIImage imageNamed:@"Main"] forState:UIControlStateNormal]; 74 | CGFloat mainButtonHeight = 60.0; 75 | CGFloat mainButtonWidth = 60.0; 76 | CGFloat mainButtonX = (CGRectGetWidth(self.view.frame) - mainButtonWidth) / 2.0; 77 | CGFloat mainButtonY = (CGRectGetHeight(self.view.frame) - mainButtonHeight) - 8.0; 78 | self.mainButton.frame = CGRectMake(mainButtonX, mainButtonY, mainButtonWidth, mainButtonHeight); 79 | self.mainButton.layer.cornerRadius = mainButtonWidth / 2.0; 80 | self.mainButton.layer.masksToBounds = YES; 81 | self.mainButton.alpha = 1.0; 82 | [self.view addSubview:self.mainButton]; 83 | } 84 | 85 | #pragma mark - YXTToolbarDelegate 86 | 87 | - (void)didPressedMainButton { 88 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Click Main Button" 89 | message:@"" 90 | delegate:nil 91 | cancelButtonTitle:@"OK" 92 | otherButtonTitles: nil]; 93 | [alert show]; 94 | } 95 | 96 | - (void)didPressedLeftButton { 97 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Click Left Button" 98 | message:@"" 99 | delegate:nil 100 | cancelButtonTitle:@"OK" 101 | otherButtonTitles: nil]; 102 | [alert show]; 103 | } 104 | 105 | - (void)didPressedRightButton { 106 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Click Right Button" 107 | message:@"" 108 | delegate:nil 109 | cancelButtonTitle:@"OK" 110 | otherButtonTitles: nil]; 111 | [alert show]; 112 | } 113 | 114 | #pragma mark - YXTSubPageDelegate 115 | 116 | - (void)pullDownDidFinish { 117 | __weak typeof(self) weakSelf = self; 118 | [UIView animateWithDuration:0.3 animations:^{ 119 | weakSelf.scrollView.contentInset = UIEdgeInsetsZero; 120 | }]; 121 | 122 | self.scrollView.contentOffset = CGPointMake(self.scrollView.contentOffset.x, self.scrollView.contentOffset.y); 123 | self.scrollView.scrollEnabled = YES; 124 | 125 | [UIView animateWithDuration:0.3 animations:^{ 126 | weakSelf.toolbarVC.view.alpha = 1.0; 127 | }]; 128 | } 129 | 130 | - (void)pullDownDidFail { 131 | [self resetToolbar]; 132 | } 133 | 134 | - (void)pullDownTransitToNextViewByPercentage:(NSNumber *)percentage { 135 | self.toolbarVC.view.alpha = [percentage floatValue]; 136 | } 137 | 138 | #pragma mark - UIScrollViewDelegate 139 | 140 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 141 | if (self.isDragging && self.scrollView.contentOffset.y >= 0) { 142 | NSNumber *percentage = [NSNumber numberWithFloat: 1.0 - (self.scrollView.contentOffset.y / YXTPullUpThreshold)]; 143 | [self pullUpTransitToNextViewByPercentage:percentage]; 144 | } 145 | } 146 | 147 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { 148 | self.isDragging = YES; 149 | } 150 | 151 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 152 | self.isDragging = NO; 153 | 154 | if(scrollView.contentOffset.y > 0 && self.scrollView.contentOffset.y >= YXTPullUpThreshold) { 155 | [self pullUpDidFinish]; 156 | } 157 | [self resetToolbar]; 158 | } 159 | 160 | #pragma mark - Private Methods 161 | 162 | - (void)pullUpDidFinish { 163 | [self.subTableViewController.tableView reloadData]; 164 | 165 | __weak typeof(self) weakSelf = self; 166 | [UIView animateWithDuration:0.3 animations:^{ 167 | weakSelf.scrollView.contentInset = UIEdgeInsetsMake(-self.scrollView.contentSize.height, 0, 0, 0); 168 | }]; 169 | 170 | self.scrollView.contentSize = CGSizeMake(self.scrollView.contentSize.width, self.scrollView.contentSize.height); 171 | self.scrollView.scrollEnabled = NO; 172 | } 173 | 174 | - (void)pullUpTransitToNextViewByPercentage:(NSNumber *)percentage { 175 | self.toolbarVC.view.alpha = [percentage floatValue]; 176 | } 177 | 178 | - (void)resetToolbar { 179 | __weak typeof(self) weakSelf = self; 180 | [UIView animateWithDuration:0.3 animations:^{ 181 | weakSelf.toolbarVC.view.alpha = 1.0; 182 | }]; 183 | } 184 | 185 | @end 186 | -------------------------------------------------------------------------------- /YXTPageView/YXTSubPageTVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YXTHotelDetailTableVC.h 3 | // HotelVIP 4 | // 5 | // Created by Hanton on 5/27/15. 6 | // Copyright (c) 2015 ZKJS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol YXTSubPageDelegate; 12 | 13 | @interface YXTSubPageTVC : UITableViewController 14 | @property (nonatomic, weak) id delegate; 15 | @property(nonatomic, weak) UIViewController *mainViewController; 16 | 17 | @end 18 | 19 | @protocol YXTSubPageDelegate 20 | - (void)pullDownDidFail; 21 | - (void)pullDownDidFinish; 22 | - (void)pullDownTransitToNextViewByPercentage:(NSNumber *)percentage; 23 | @end 24 | -------------------------------------------------------------------------------- /YXTPageView/YXTSubPageTVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // YXTHotelDetailTableVC.m 3 | // HotelVIP 4 | // 5 | // Created by Hanton on 5/27/15. 6 | // Copyright (c) 2015 ZKJS. All rights reserved. 7 | // 8 | 9 | #import "YXTSubPageTVC.h" 10 | 11 | static const CGFloat YXTPullDownThreshold = 50.0; 12 | 13 | @interface YXTSubPageTVC () 14 | @property (nonatomic) BOOL isDragging; 15 | @end 16 | 17 | @implementation YXTSubPageTVC 18 | 19 | #pragma mark - View Lifecycle 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | self.isDragging = NO; 25 | } 26 | 27 | #pragma mark - UIScrollViewDelegate 28 | 29 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { 30 | self.isDragging = YES; 31 | } 32 | 33 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 34 | if (self.isDragging && scrollView.contentOffset.y <= 0.0) { 35 | if ([self.delegate respondsToSelector:@selector(pullDownTransitToNextViewByPercentage:)]) { 36 | CGFloat pullDownOffset = (scrollView.contentOffset.y + YXTPullDownThreshold) / YXTPullDownThreshold; 37 | if (pullDownOffset < 0.0) { 38 | pullDownOffset = 0.0; 39 | } 40 | NSNumber *percentage = [NSNumber numberWithFloat:pullDownOffset]; 41 | [self.delegate performSelector:@selector(pullDownTransitToNextViewByPercentage:) withObject:percentage]; 42 | } 43 | } 44 | } 45 | 46 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 47 | self.isDragging = NO; 48 | 49 | if(scrollView.contentOffset.y <= -YXTPullDownThreshold) { 50 | if ([self.delegate respondsToSelector:@selector(pullDownDidFinish)]) { 51 | [self.delegate performSelector:@selector(pullDownDidFinish) withObject:nil]; 52 | } 53 | } else if(scrollView.contentOffset.y < 0.0) { 54 | if ([self.delegate respondsToSelector:@selector(pullDownDidFail)]) { 55 | [self.delegate performSelector:@selector(pullDownDidFail) withObject:nil]; 56 | } 57 | } 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /YXTPageView/YXTToolbarVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YXTToobar.h 3 | // HotelVIP 4 | // 5 | // Created by Hanton on 5/27/15. 6 | // Copyright (c) 2015 ZKJS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol YXTToolbarDelegate; 12 | 13 | @interface YXTToolbarVC : UIViewController 14 | @property (nonatomic, weak) id delegate; 15 | @end 16 | 17 | @protocol YXTToolbarDelegate 18 | - (void)didPressedLeftButton; 19 | - (void)didPressedRightButton; 20 | @end 21 | -------------------------------------------------------------------------------- /YXTPageView/YXTToolbarVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // YXTToobar.m 3 | // HotelVIP 4 | // 5 | // Created by Hanton on 5/27/15. 6 | // Copyright (c) 2015 ZKJS. All rights reserved. 7 | // 8 | 9 | #import "YXTToolbarVC.h" 10 | 11 | @interface YXTToolbarVC () 12 | 13 | @end 14 | 15 | @implementation YXTToolbarVC 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | } 21 | 22 | - (IBAction)pressPhoneButton:(id)sender { 23 | if ([self.delegate respondsToSelector:@selector(didPressedLeftButton)]) { 24 | [self.delegate performSelector:@selector(didPressedLeftButton) withObject:nil]; 25 | } 26 | } 27 | 28 | - (IBAction)pressMapButton:(id)sender { 29 | if ([self.delegate respondsToSelector:@selector(didPressedRightButton)]) { 30 | [self.delegate performSelector:@selector(didPressedRightButton) withObject:nil]; 31 | } 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /YXTPageView/YXTToolbarVC.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 28 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /YXTPageViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 408965891B32DA6F002A39A2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 408965881B32DA6F002A39A2 /* main.m */; }; 11 | 4089658C1B32DA6F002A39A2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4089658B1B32DA6F002A39A2 /* AppDelegate.m */; }; 12 | 4089658F1B32DA6F002A39A2 /* MainPageVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 4089658E1B32DA6F002A39A2 /* MainPageVC.m */; }; 13 | 408965941B32DA6F002A39A2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 408965931B32DA6F002A39A2 /* Images.xcassets */; }; 14 | 408965971B32DA6F002A39A2 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 408965951B32DA6F002A39A2 /* LaunchScreen.xib */; }; 15 | 408965A31B32DA6F002A39A2 /* YXTPageViewDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 408965A21B32DA6F002A39A2 /* YXTPageViewDemoTests.m */; }; 16 | 408965B41B32DADE002A39A2 /* YXTMainPageVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 408965AE1B32DADE002A39A2 /* YXTMainPageVC.m */; }; 17 | 408965B51B32DADE002A39A2 /* YXTSubPageTVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 408965B01B32DADE002A39A2 /* YXTSubPageTVC.m */; }; 18 | 408965B61B32DADE002A39A2 /* YXTToolbarVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 408965B21B32DADE002A39A2 /* YXTToolbarVC.m */; }; 19 | 408965B71B32DADE002A39A2 /* YXTToolbarVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 408965B31B32DADE002A39A2 /* YXTToolbarVC.xib */; }; 20 | 408965C01B32DC43002A39A2 /* SubPageTVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 408965BF1B32DC43002A39A2 /* SubPageTVC.m */; }; 21 | 408965C41B32DE45002A39A2 /* SubPageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 408965C21B32DE45002A39A2 /* SubPageCell.m */; }; 22 | 408965C51B32DE45002A39A2 /* SubPageCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 408965C31B32DE45002A39A2 /* SubPageCell.xib */; }; 23 | 40DE7FC91B57589500C29476 /* MainPage.xib in Resources */ = {isa = PBXBuildFile; fileRef = 40DE7FC81B57589500C29476 /* MainPage.xib */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 4089659D1B32DA6F002A39A2 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 4089657B1B32DA6F002A39A2 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 408965821B32DA6F002A39A2; 32 | remoteInfo = YXTPageViewDemo; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 408965831B32DA6F002A39A2 /* YXTPageViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YXTPageViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 408965871B32DA6F002A39A2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 408965881B32DA6F002A39A2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | 4089658A1B32DA6F002A39A2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | 4089658B1B32DA6F002A39A2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | 4089658D1B32DA6F002A39A2 /* MainPageVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainPageVC.h; sourceTree = ""; }; 43 | 4089658E1B32DA6F002A39A2 /* MainPageVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainPageVC.m; sourceTree = ""; }; 44 | 408965931B32DA6F002A39A2 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 45 | 408965961B32DA6F002A39A2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 46 | 4089659C1B32DA6F002A39A2 /* YXTPageViewDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YXTPageViewDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 408965A11B32DA6F002A39A2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 408965A21B32DA6F002A39A2 /* YXTPageViewDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YXTPageViewDemoTests.m; sourceTree = ""; }; 49 | 408965AD1B32DADE002A39A2 /* YXTMainPageVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = YXTMainPageVC.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 50 | 408965AE1B32DADE002A39A2 /* YXTMainPageVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = YXTMainPageVC.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 51 | 408965AF1B32DADE002A39A2 /* YXTSubPageTVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = YXTSubPageTVC.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 52 | 408965B01B32DADE002A39A2 /* YXTSubPageTVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = YXTSubPageTVC.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 53 | 408965B11B32DADE002A39A2 /* YXTToolbarVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YXTToolbarVC.h; sourceTree = ""; }; 54 | 408965B21B32DADE002A39A2 /* YXTToolbarVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YXTToolbarVC.m; sourceTree = ""; }; 55 | 408965B31B32DADE002A39A2 /* YXTToolbarVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = YXTToolbarVC.xib; sourceTree = ""; }; 56 | 408965BE1B32DC43002A39A2 /* SubPageTVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubPageTVC.h; sourceTree = ""; }; 57 | 408965BF1B32DC43002A39A2 /* SubPageTVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SubPageTVC.m; sourceTree = ""; }; 58 | 408965C11B32DE45002A39A2 /* SubPageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubPageCell.h; sourceTree = ""; }; 59 | 408965C21B32DE45002A39A2 /* SubPageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SubPageCell.m; sourceTree = ""; }; 60 | 408965C31B32DE45002A39A2 /* SubPageCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SubPageCell.xib; sourceTree = ""; }; 61 | 40DE7FC81B57589500C29476 /* MainPage.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainPage.xib; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | 408965801B32DA6F002A39A2 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 408965991B32DA6F002A39A2 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | /* End PBXFrameworksBuildPhase section */ 80 | 81 | /* Begin PBXGroup section */ 82 | 4089657A1B32DA6F002A39A2 = { 83 | isa = PBXGroup; 84 | children = ( 85 | 408965AC1B32DADE002A39A2 /* YXTPageView */, 86 | 408965851B32DA6F002A39A2 /* YXTPageViewDemo */, 87 | 4089659F1B32DA6F002A39A2 /* YXTPageViewDemoTests */, 88 | 408965841B32DA6F002A39A2 /* Products */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | 408965841B32DA6F002A39A2 /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 408965831B32DA6F002A39A2 /* YXTPageViewDemo.app */, 96 | 4089659C1B32DA6F002A39A2 /* YXTPageViewDemoTests.xctest */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 408965851B32DA6F002A39A2 /* YXTPageViewDemo */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 4089658A1B32DA6F002A39A2 /* AppDelegate.h */, 105 | 4089658B1B32DA6F002A39A2 /* AppDelegate.m */, 106 | 4089658D1B32DA6F002A39A2 /* MainPageVC.h */, 107 | 4089658E1B32DA6F002A39A2 /* MainPageVC.m */, 108 | 40DE7FC81B57589500C29476 /* MainPage.xib */, 109 | 408965BE1B32DC43002A39A2 /* SubPageTVC.h */, 110 | 408965BF1B32DC43002A39A2 /* SubPageTVC.m */, 111 | 408965C11B32DE45002A39A2 /* SubPageCell.h */, 112 | 408965C21B32DE45002A39A2 /* SubPageCell.m */, 113 | 408965C31B32DE45002A39A2 /* SubPageCell.xib */, 114 | 408965861B32DA6F002A39A2 /* Supporting Files */, 115 | ); 116 | path = YXTPageViewDemo; 117 | sourceTree = ""; 118 | }; 119 | 408965861B32DA6F002A39A2 /* Supporting Files */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 408965931B32DA6F002A39A2 /* Images.xcassets */, 123 | 408965951B32DA6F002A39A2 /* LaunchScreen.xib */, 124 | 408965871B32DA6F002A39A2 /* Info.plist */, 125 | 408965881B32DA6F002A39A2 /* main.m */, 126 | ); 127 | name = "Supporting Files"; 128 | sourceTree = ""; 129 | }; 130 | 4089659F1B32DA6F002A39A2 /* YXTPageViewDemoTests */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 408965A21B32DA6F002A39A2 /* YXTPageViewDemoTests.m */, 134 | 408965A01B32DA6F002A39A2 /* Supporting Files */, 135 | ); 136 | path = YXTPageViewDemoTests; 137 | sourceTree = ""; 138 | }; 139 | 408965A01B32DA6F002A39A2 /* Supporting Files */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 408965A11B32DA6F002A39A2 /* Info.plist */, 143 | ); 144 | name = "Supporting Files"; 145 | sourceTree = ""; 146 | }; 147 | 408965AC1B32DADE002A39A2 /* YXTPageView */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 408965AD1B32DADE002A39A2 /* YXTMainPageVC.h */, 151 | 408965AE1B32DADE002A39A2 /* YXTMainPageVC.m */, 152 | 408965AF1B32DADE002A39A2 /* YXTSubPageTVC.h */, 153 | 408965B01B32DADE002A39A2 /* YXTSubPageTVC.m */, 154 | 408965B11B32DADE002A39A2 /* YXTToolbarVC.h */, 155 | 408965B21B32DADE002A39A2 /* YXTToolbarVC.m */, 156 | 408965B31B32DADE002A39A2 /* YXTToolbarVC.xib */, 157 | ); 158 | path = YXTPageView; 159 | sourceTree = ""; 160 | }; 161 | /* End PBXGroup section */ 162 | 163 | /* Begin PBXNativeTarget section */ 164 | 408965821B32DA6F002A39A2 /* YXTPageViewDemo */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = 408965A61B32DA6F002A39A2 /* Build configuration list for PBXNativeTarget "YXTPageViewDemo" */; 167 | buildPhases = ( 168 | 4089657F1B32DA6F002A39A2 /* Sources */, 169 | 408965801B32DA6F002A39A2 /* Frameworks */, 170 | 408965811B32DA6F002A39A2 /* Resources */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | ); 176 | name = YXTPageViewDemo; 177 | productName = YXTPageViewDemo; 178 | productReference = 408965831B32DA6F002A39A2 /* YXTPageViewDemo.app */; 179 | productType = "com.apple.product-type.application"; 180 | }; 181 | 4089659B1B32DA6F002A39A2 /* YXTPageViewDemoTests */ = { 182 | isa = PBXNativeTarget; 183 | buildConfigurationList = 408965A91B32DA6F002A39A2 /* Build configuration list for PBXNativeTarget "YXTPageViewDemoTests" */; 184 | buildPhases = ( 185 | 408965981B32DA6F002A39A2 /* Sources */, 186 | 408965991B32DA6F002A39A2 /* Frameworks */, 187 | 4089659A1B32DA6F002A39A2 /* Resources */, 188 | ); 189 | buildRules = ( 190 | ); 191 | dependencies = ( 192 | 4089659E1B32DA6F002A39A2 /* PBXTargetDependency */, 193 | ); 194 | name = YXTPageViewDemoTests; 195 | productName = YXTPageViewDemoTests; 196 | productReference = 4089659C1B32DA6F002A39A2 /* YXTPageViewDemoTests.xctest */; 197 | productType = "com.apple.product-type.bundle.unit-test"; 198 | }; 199 | /* End PBXNativeTarget section */ 200 | 201 | /* Begin PBXProject section */ 202 | 4089657B1B32DA6F002A39A2 /* Project object */ = { 203 | isa = PBXProject; 204 | attributes = { 205 | LastUpgradeCheck = 0630; 206 | ORGANIZATIONNAME = YXT; 207 | TargetAttributes = { 208 | 408965821B32DA6F002A39A2 = { 209 | CreatedOnToolsVersion = 6.3.2; 210 | }; 211 | 4089659B1B32DA6F002A39A2 = { 212 | CreatedOnToolsVersion = 6.3.2; 213 | TestTargetID = 408965821B32DA6F002A39A2; 214 | }; 215 | }; 216 | }; 217 | buildConfigurationList = 4089657E1B32DA6F002A39A2 /* Build configuration list for PBXProject "YXTPageViewDemo" */; 218 | compatibilityVersion = "Xcode 3.2"; 219 | developmentRegion = English; 220 | hasScannedForEncodings = 0; 221 | knownRegions = ( 222 | en, 223 | Base, 224 | ); 225 | mainGroup = 4089657A1B32DA6F002A39A2; 226 | productRefGroup = 408965841B32DA6F002A39A2 /* Products */; 227 | projectDirPath = ""; 228 | projectRoot = ""; 229 | targets = ( 230 | 408965821B32DA6F002A39A2 /* YXTPageViewDemo */, 231 | 4089659B1B32DA6F002A39A2 /* YXTPageViewDemoTests */, 232 | ); 233 | }; 234 | /* End PBXProject section */ 235 | 236 | /* Begin PBXResourcesBuildPhase section */ 237 | 408965811B32DA6F002A39A2 /* Resources */ = { 238 | isa = PBXResourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | 40DE7FC91B57589500C29476 /* MainPage.xib in Resources */, 242 | 408965971B32DA6F002A39A2 /* LaunchScreen.xib in Resources */, 243 | 408965B71B32DADE002A39A2 /* YXTToolbarVC.xib in Resources */, 244 | 408965941B32DA6F002A39A2 /* Images.xcassets in Resources */, 245 | 408965C51B32DE45002A39A2 /* SubPageCell.xib in Resources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | 4089659A1B32DA6F002A39A2 /* Resources */ = { 250 | isa = PBXResourcesBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXResourcesBuildPhase section */ 257 | 258 | /* Begin PBXSourcesBuildPhase section */ 259 | 4089657F1B32DA6F002A39A2 /* Sources */ = { 260 | isa = PBXSourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | 4089658F1B32DA6F002A39A2 /* MainPageVC.m in Sources */, 264 | 4089658C1B32DA6F002A39A2 /* AppDelegate.m in Sources */, 265 | 408965C41B32DE45002A39A2 /* SubPageCell.m in Sources */, 266 | 408965B51B32DADE002A39A2 /* YXTSubPageTVC.m in Sources */, 267 | 408965B41B32DADE002A39A2 /* YXTMainPageVC.m in Sources */, 268 | 408965B61B32DADE002A39A2 /* YXTToolbarVC.m in Sources */, 269 | 408965891B32DA6F002A39A2 /* main.m in Sources */, 270 | 408965C01B32DC43002A39A2 /* SubPageTVC.m in Sources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | 408965981B32DA6F002A39A2 /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 408965A31B32DA6F002A39A2 /* YXTPageViewDemoTests.m in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | /* End PBXSourcesBuildPhase section */ 283 | 284 | /* Begin PBXTargetDependency section */ 285 | 4089659E1B32DA6F002A39A2 /* PBXTargetDependency */ = { 286 | isa = PBXTargetDependency; 287 | target = 408965821B32DA6F002A39A2 /* YXTPageViewDemo */; 288 | targetProxy = 4089659D1B32DA6F002A39A2 /* PBXContainerItemProxy */; 289 | }; 290 | /* End PBXTargetDependency section */ 291 | 292 | /* Begin PBXVariantGroup section */ 293 | 408965951B32DA6F002A39A2 /* LaunchScreen.xib */ = { 294 | isa = PBXVariantGroup; 295 | children = ( 296 | 408965961B32DA6F002A39A2 /* Base */, 297 | ); 298 | name = LaunchScreen.xib; 299 | sourceTree = ""; 300 | }; 301 | /* End PBXVariantGroup section */ 302 | 303 | /* Begin XCBuildConfiguration section */ 304 | 408965A41B32DA6F002A39A2 /* Debug */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | ALWAYS_SEARCH_USER_PATHS = NO; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 319 | CLANG_WARN_UNREACHABLE_CODE = YES; 320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 321 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 322 | COPY_PHASE_STRIP = NO; 323 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 324 | ENABLE_STRICT_OBJC_MSGSEND = YES; 325 | GCC_C_LANGUAGE_STANDARD = gnu99; 326 | GCC_DYNAMIC_NO_PIC = NO; 327 | GCC_NO_COMMON_BLOCKS = YES; 328 | GCC_OPTIMIZATION_LEVEL = 0; 329 | GCC_PREPROCESSOR_DEFINITIONS = ( 330 | "DEBUG=1", 331 | "$(inherited)", 332 | ); 333 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 334 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 335 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 336 | GCC_WARN_UNDECLARED_SELECTOR = YES; 337 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 338 | GCC_WARN_UNUSED_FUNCTION = YES; 339 | GCC_WARN_UNUSED_VARIABLE = YES; 340 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 341 | MTL_ENABLE_DEBUG_INFO = YES; 342 | ONLY_ACTIVE_ARCH = YES; 343 | SDKROOT = iphoneos; 344 | TARGETED_DEVICE_FAMILY = "1,2"; 345 | }; 346 | name = Debug; 347 | }; 348 | 408965A51B32DA6F002A39A2 /* Release */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ALWAYS_SEARCH_USER_PATHS = NO; 352 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 353 | CLANG_CXX_LIBRARY = "libc++"; 354 | CLANG_ENABLE_MODULES = YES; 355 | CLANG_ENABLE_OBJC_ARC = YES; 356 | CLANG_WARN_BOOL_CONVERSION = YES; 357 | CLANG_WARN_CONSTANT_CONVERSION = YES; 358 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INT_CONVERSION = YES; 362 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 363 | CLANG_WARN_UNREACHABLE_CODE = YES; 364 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 365 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 366 | COPY_PHASE_STRIP = NO; 367 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 368 | ENABLE_NS_ASSERTIONS = NO; 369 | ENABLE_STRICT_OBJC_MSGSEND = YES; 370 | GCC_C_LANGUAGE_STANDARD = gnu99; 371 | GCC_NO_COMMON_BLOCKS = YES; 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 379 | MTL_ENABLE_DEBUG_INFO = NO; 380 | SDKROOT = iphoneos; 381 | TARGETED_DEVICE_FAMILY = "1,2"; 382 | VALIDATE_PRODUCT = YES; 383 | }; 384 | name = Release; 385 | }; 386 | 408965A71B32DA6F002A39A2 /* Debug */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 390 | INFOPLIST_FILE = YXTPageViewDemo/Info.plist; 391 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 392 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 393 | PRODUCT_NAME = "$(TARGET_NAME)"; 394 | }; 395 | name = Debug; 396 | }; 397 | 408965A81B32DA6F002A39A2 /* Release */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 401 | INFOPLIST_FILE = YXTPageViewDemo/Info.plist; 402 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | }; 406 | name = Release; 407 | }; 408 | 408965AA1B32DA6F002A39A2 /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | buildSettings = { 411 | BUNDLE_LOADER = "$(TEST_HOST)"; 412 | FRAMEWORK_SEARCH_PATHS = ( 413 | "$(SDKROOT)/Developer/Library/Frameworks", 414 | "$(inherited)", 415 | ); 416 | GCC_PREPROCESSOR_DEFINITIONS = ( 417 | "DEBUG=1", 418 | "$(inherited)", 419 | ); 420 | INFOPLIST_FILE = YXTPageViewDemoTests/Info.plist; 421 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YXTPageViewDemo.app/YXTPageViewDemo"; 424 | }; 425 | name = Debug; 426 | }; 427 | 408965AB1B32DA6F002A39A2 /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | BUNDLE_LOADER = "$(TEST_HOST)"; 431 | FRAMEWORK_SEARCH_PATHS = ( 432 | "$(SDKROOT)/Developer/Library/Frameworks", 433 | "$(inherited)", 434 | ); 435 | INFOPLIST_FILE = YXTPageViewDemoTests/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YXTPageViewDemo.app/YXTPageViewDemo"; 439 | }; 440 | name = Release; 441 | }; 442 | /* End XCBuildConfiguration section */ 443 | 444 | /* Begin XCConfigurationList section */ 445 | 4089657E1B32DA6F002A39A2 /* Build configuration list for PBXProject "YXTPageViewDemo" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | 408965A41B32DA6F002A39A2 /* Debug */, 449 | 408965A51B32DA6F002A39A2 /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | 408965A61B32DA6F002A39A2 /* Build configuration list for PBXNativeTarget "YXTPageViewDemo" */ = { 455 | isa = XCConfigurationList; 456 | buildConfigurations = ( 457 | 408965A71B32DA6F002A39A2 /* Debug */, 458 | 408965A81B32DA6F002A39A2 /* Release */, 459 | ); 460 | defaultConfigurationIsVisible = 0; 461 | defaultConfigurationName = Release; 462 | }; 463 | 408965A91B32DA6F002A39A2 /* Build configuration list for PBXNativeTarget "YXTPageViewDemoTests" */ = { 464 | isa = XCConfigurationList; 465 | buildConfigurations = ( 466 | 408965AA1B32DA6F002A39A2 /* Debug */, 467 | 408965AB1B32DA6F002A39A2 /* Release */, 468 | ); 469 | defaultConfigurationIsVisible = 0; 470 | defaultConfigurationName = Release; 471 | }; 472 | /* End XCConfigurationList section */ 473 | }; 474 | rootObject = 4089657B1B32DA6F002A39A2 /* Project object */; 475 | } 476 | -------------------------------------------------------------------------------- /YXTPageViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YXTPageViewDemo.xcodeproj/project.xcworkspace/xcshareddata/YXTPageViewDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | CDE17DD7-0AAD-4394-8A9F-CDD438751562 9 | IDESourceControlProjectName 10 | YXTPageViewDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 8E104D291BE97E78E4EC1D19E5EE28A576F3F657 14 | github.com:hanton/YXTPageView.git 15 | 16 | IDESourceControlProjectPath 17 | YXTPageViewDemo.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 8E104D291BE97E78E4EC1D19E5EE28A576F3F657 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:hanton/YXTPageView.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 8E104D291BE97E78E4EC1D19E5EE28A576F3F657 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 8E104D291BE97E78E4EC1D19E5EE28A576F3F657 36 | IDESourceControlWCCName 37 | YXTPageView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /YXTPageViewDemo.xcodeproj/project.xcworkspace/xcuserdata/hanton.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo.xcodeproj/project.xcworkspace/xcuserdata/hanton.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /YXTPageViewDemo.xcodeproj/project.xcworkspace/xcuserdata/hanton.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /YXTPageViewDemo.xcodeproj/xcuserdata/hanton.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /YXTPageViewDemo.xcodeproj/xcuserdata/hanton.xcuserdatad/xcschemes/YXTPageViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /YXTPageViewDemo.xcodeproj/xcuserdata/hanton.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | YXTPageViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 408965821B32DA6F002A39A2 16 | 17 | primary 18 | 19 | 20 | 4089659B1B32DA6F002A39A2 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /YXTPageViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // YXTPageViewDemo 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /YXTPageViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // YXTPageViewDemo 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "MainPageVC.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; 21 | self.window.rootViewController = [MainPageVC new]; 22 | [self.window makeKeyAndVisible]; 23 | return YES; 24 | } 25 | 26 | - (void)applicationWillResignActive:(UIApplication *)application { 27 | // 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. 28 | // 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. 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application { 32 | // 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. 33 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 34 | } 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // 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. 38 | } 39 | 40 | - (void)applicationDidBecomeActive:(UIApplication *)application { 41 | // 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. 42 | } 43 | 44 | - (void)applicationWillTerminate:(UIApplication *)application { 45 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /YXTPageViewDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-Small@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-Small@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-60@2x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-60@2x-1.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-60@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "29x29", 41 | "idiom" : "ipad", 42 | "filename" : "Icon-Small.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "Icon-Small@2x-1.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "40x40", 53 | "idiom" : "ipad", 54 | "filename" : "Icon-40.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-40@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "76x76", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-76.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "76x76", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-76@2x.png", 73 | "scale" : "2x" 74 | } 75 | ], 76 | "info" : { 77 | "version" : 1, 78 | "author" : "xcode" 79 | } 80 | } -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-40@2x-1.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-60@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-60@2x-1.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-Small.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/Left.imageset/062.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/Left.imageset/062.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/Left.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "062.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/Main.imageset/025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/Main.imageset/025.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/Main.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "025.png" 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 | } -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/Right.imageset/063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/Right.imageset/063.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/Right.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "063.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/img_background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "img_background@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "img_background@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/img_background.imageset/img_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/img_background.imageset/img_background@2x.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Images.xcassets/img_background.imageset/img_background@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/YXTPageViewDemo/Images.xcassets/img_background.imageset/img_background@3x.png -------------------------------------------------------------------------------- /YXTPageViewDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.hanton.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /YXTPageViewDemo/MainPage.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /YXTPageViewDemo/MainPageVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // YXTPageViewDemo 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YXTMainPageVC.h" 11 | 12 | @interface MainPageVC : YXTMainPageVC 13 | 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /YXTPageViewDemo/MainPageVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // YXTPageViewDemo 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import "MainPageVC.h" 10 | #import "SubPageTVC.h" 11 | 12 | @interface MainPageVC () 13 | 14 | @end 15 | 16 | @implementation MainPageVC 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | self.scrollView.backgroundColor = [UIColor colorWithRed:213.0/255.0 green:197.0/255.0 blue:174.0/255.0 alpha:1.0]; 22 | 23 | UIView *mainPage = [[[NSBundle mainBundle] loadNibNamed:@"MainPage" owner:self options:nil] firstObject]; 24 | mainPage.frame = self.view.bounds; 25 | [self.scrollView addSubview:mainPage]; 26 | 27 | self.subTableViewController = [SubPageTVC new]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /YXTPageViewDemo/SubPageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // SubPageCell.h 3 | // YXTPageViewDemo 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SubPageCell : UITableViewCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YXTPageViewDemo/SubPageCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // SubPageCell.m 3 | // YXTPageViewDemo 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import "SubPageCell.h" 10 | 11 | @implementation SubPageCell 12 | 13 | - (void)awakeFromNib { 14 | // Initialization code 15 | } 16 | 17 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 18 | [super setSelected:selected animated:animated]; 19 | 20 | // Configure the view for the selected state 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /YXTPageViewDemo/SubPageCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /YXTPageViewDemo/SubPageTVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // SubPageTVC.h 3 | // YXTPageViewDemo 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YXTSubPageTVC.h" 11 | 12 | @interface SubPageTVC : YXTSubPageTVC 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /YXTPageViewDemo/SubPageTVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // SubPageTVC.m 3 | // YXTPageViewDemo 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import "SubPageTVC.h" 10 | #import "SubPageCell.h" 11 | 12 | static NSString* const SubPageCellIdentifier = @"SubPageCell"; 13 | 14 | @interface SubPageTVC () 15 | 16 | @end 17 | 18 | @implementation SubPageTVC 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([SubPageCell class]) bundle:nil] forCellReuseIdentifier:SubPageCellIdentifier]; 24 | 25 | self.tableView.delegate = self; 26 | self.tableView.dataSource = self; 27 | self.tableView.showsVerticalScrollIndicator = NO; 28 | self.tableView.backgroundColor = [UIColor colorWithRed:213.0/255.0 green:197.0/255.0 blue:174.0/255.0 alpha:1.0]; 29 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched; 30 | 31 | self.clearsSelectionOnViewWillAppear = YES; 32 | } 33 | 34 | #pragma mark - Table view data source 35 | 36 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 37 | return 1; 38 | } 39 | 40 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 41 | return 10; 42 | } 43 | 44 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 45 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SubPageCellIdentifier forIndexPath:indexPath]; 46 | 47 | // Configure the cell... 48 | 49 | return cell; 50 | } 51 | 52 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 53 | return 150.0; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /YXTPageViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // YXTPageViewDemo 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /YXTPageViewDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.hanton.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /YXTPageViewDemoTests/YXTPageViewDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // YXTPageViewDemoTests.m 3 | // YXTPageViewDemoTests 4 | // 5 | // Created by Hanton on 6/18/15. 6 | // Copyright (c) 2015 YXT. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface YXTPageViewDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation YXTPageViewDemoTests 17 | 18 | - (void)setUp { 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 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /screenshots/YXTPageView.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/screenshots/YXTPageView.gif -------------------------------------------------------------------------------- /screenshots/YXTPageView.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanton/YXTPageView/71989f16bf3380151d62c872ec155c36aa1984ce/screenshots/YXTPageView.mov --------------------------------------------------------------------------------