From f92994046da63b29371d59e0ac77f1521d602406 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=93=A5=E5=93=A5=E5=B8=85?= <1357127436@qq.com>
Date: Sat, 27 Jul 2019 18:11:11 +0800
Subject: [PATCH] [Releases 1.6.7]
---
README.md | 8 +-
SGPagingView.podspec | 2 +-
SGPagingView/SGPageTitle/SGPageTitleView.m | 21 +-
SGPagingView/SGPagingView.h | 2 +-
SGPagingViewExample.xcodeproj/project.pbxproj | 6 +
.../MainVC/DefaultTopBottomVC.h | 17 ++
.../MainVC/DefaultTopBottomVC.m | 185 ++++++++++++++++++
SGPagingViewExample/ViewController.m | 25 ++-
8 files changed, 246 insertions(+), 20 deletions(-)
create mode 100644 SGPagingViewExample/MainVC/DefaultTopBottomVC.h
create mode 100644 SGPagingViewExample/MainVC/DefaultTopBottomVC.m
diff --git a/README.md b/README.md
index bd9f7bd..94e8ce9 100644
--- a/README.md
+++ b/README.md
@@ -43,15 +43,17 @@ SGPageContentCollectionView(内部由 UICollectionView 实现)
* `指示器长度自定义`
+* `多种指示器滚动样式`
+
* `标题文字渐显效果`
* `标题文字缩放效果`
-* `多种指示器滚动样式`
+* `标题文字富文本样式`
## Installation
-* 1、CocoaPods 导入 pod 'SGPagingView', '~> 1.6.6'
+* 1、CocoaPods 导入 pod 'SGPagingView', '~> 1.6.7'
* 2、下载、拖拽 “SGPagingView” 文件夹到工程中
@@ -180,6 +182,8 @@ b. 实现 SGPageContentScrollView 的 pageContentScrollView:index:代理方法
* 2019-07-22 :v1.6.6 SGPageTitleViewConfigure 新增 equivalence 属性支持静止样式下标题从左到右自动布局
+* 2019-07-27 :v1.6.7 支持标题文字上下行样式以及 titleGradientEffect 属性与 resetTitleColor:titleSelectedColor: 方法的兼容
+
## License
SGPagingView is released under the MIT license. See [LICENSE](https://github.com/kingsic/SGPagingView/blob/master/LICENSE) for details.
diff --git a/SGPagingView.podspec b/SGPagingView.podspec
index 6a875ed..5e73a8b 100644
--- a/SGPagingView.podspec
+++ b/SGPagingView.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'SGPagingView'
- s.version = '1.6.6'
+ s.version = '1.6.7'
s.summary = 'A powerful and easy to use segment control'
s.homepage = 'https://github.com/kingsic/SGPagingView'
s.license = 'MIT'
diff --git a/SGPagingView/SGPageTitle/SGPageTitleView.m b/SGPagingView/SGPageTitle/SGPageTitleView.m
index 9e01283..024d3b3 100755
--- a/SGPagingView/SGPageTitle/SGPageTitleView.m
+++ b/SGPagingView/SGPageTitle/SGPageTitleView.m
@@ -303,6 +303,8 @@ - (void)setupTitleButtons {
SGPageTitleButton *btn = [[SGPageTitleButton alloc] init];
btn.tag = index;
btn.titleLabel.font = self.configure.titleFont;
+ btn.titleLabel.textAlignment = NSTextAlignmentCenter;
+ btn.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
[btn setTitle:self.titleArr[index] forState:(UIControlStateNormal)];
[btn setTitleColor:self.configure.titleColor forState:(UIControlStateNormal)];
[btn setTitleColor:self.configure.titleSelectedColor forState:(UIControlStateSelected)];
@@ -365,7 +367,7 @@ - (void)P_changeSelectedButton:(UIButton *)button {
UIFont *defaultTitleFont = [UIFont systemFontOfSize:15];
if ([configureTitleSelectedFont.fontName isEqualToString:defaultTitleFont.fontName] && configureTitleSelectedFont.pointSize == defaultTitleFont.pointSize) {
// 标题文字缩放属性(开启 titleSelectedFont 属性将不起作用)
- if (self.configure.titleTextZoom == YES) {
+ if (self.configure.titleTextZoom) {
[self.btnMArr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
UIButton *btn = obj;
btn.transform = CGAffineTransformIdentity;
@@ -397,7 +399,7 @@ - (void)P_changeSelectedButton:(UIButton *)button {
}
// 此处作用:避免滚动过程中点击标题手指不离开屏幕的前提下再次滚动造成的误差(由于文字渐变效果导致未选中标题的不准确处理)
- if (self.configure.titleGradientEffect == YES) {
+ if (self.configure.titleGradientEffect) {
[self.btnMArr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
UIButton *btn = obj;
btn.titleLabel.textColor = self.configure.titleColor;
@@ -406,7 +408,7 @@ - (void)P_changeSelectedButton:(UIButton *)button {
}
} else {
// 此处作用:避免滚动过程中点击标题手指不离开屏幕的前提下再次滚动造成的误差(由于文字渐变效果导致未选中标题的不准确处理)
- if (self.configure.titleGradientEffect == YES) {
+ if (self.configure.titleGradientEffect) {
[self.btnMArr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
UIButton *btn = obj;
btn.titleLabel.textColor = self.configure.titleColor;
@@ -502,7 +504,7 @@ - (void)setPageTitleViewWithProgress:(CGFloat)progress originalIndex:(NSInteger)
}
}
// 4、颜色的渐变(复杂)
- if (self.configure.titleGradientEffect == YES) {
+ if (self.configure.titleGradientEffect) {
[self P_isTitleGradientEffectWithProgress:progress originalBtn:originalBtn targetBtn:targetBtn];
}
@@ -510,7 +512,7 @@ - (void)setPageTitleViewWithProgress:(CGFloat)progress originalIndex:(NSInteger)
UIFont *configureTitleSelectedFont = self.configure.titleSelectedFont;
UIFont *defaultTitleFont = [UIFont systemFontOfSize:15];
if ([configureTitleSelectedFont.fontName isEqualToString:defaultTitleFont.fontName] && configureTitleSelectedFont.pointSize == defaultTitleFont.pointSize) {
- if (self.configure.titleTextZoom == YES) {
+ if (self.configure.titleTextZoom) {
// originalBtn 缩放
CGFloat originalBtnZoomRatio = (1 - progress) * self.configure.titleTextZoomRatio;
originalBtn.transform = CGAffineTransformMakeScale(originalBtnZoomRatio + 1, originalBtnZoomRatio + 1);
@@ -593,6 +595,13 @@ - (void)resetTitleColor:(UIColor *)color titleSelectedColor:(UIColor *)selectedC
[btn setTitleColor:color forState:(UIControlStateNormal)];
[btn setTitleColor:selectedColor forState:(UIControlStateSelected)];
}];
+
+ if (self.configure.titleGradientEffect) {
+ self.configure.titleColor = color;
+ self.configure.titleSelectedColor = selectedColor;
+ [self setupStartColor:self.configure.titleColor];
+ [self setupEndColor:self.configure.titleSelectedColor];
+ }
}
/**
* 重置标题普通状态、选中状态下文字颜色及指示器颜色方法
@@ -782,7 +791,7 @@ - (void)P_staticIndicatorScrollStyleDefaultWithProgress:(CGFloat)progress origin
CGFloat originalBtnMaxX = 0.0;
/// 这里的缩放是标题按钮缩放,按钮的 frame 会发生变化,开启缩放性后,如果指示器还使用 CGRectGetMaxX 获取按钮的最大 X 值是会比之前的值大,这样会导致指示器的位置相对按钮位置不对应(存在一定的偏移);所以这里根据按钮下标计算原本的 CGRectGetMaxX 的值,缩放后的不去理会,这样指示器位置会与按钮位置保持一致。
/// 在缩放属性关闭情况下,下面的计算结果一样的,所以可以省略判断,直接采用第一种计算结果(这个只是做个记录对指示器位置与按钮保持一致的方法)
- if (self.configure.titleTextZoom == YES) {
+ if (self.configure.titleTextZoom) {
targetBtnMaxX = (targetBtn.tag + 1) * btnWidth;
originalBtnMaxX = (originalBtn.tag + 1) * btnWidth;
} else {
diff --git a/SGPagingView/SGPagingView.h b/SGPagingView/SGPagingView.h
index 0fe72e1..ddf8973 100755
--- a/SGPagingView/SGPagingView.h
+++ b/SGPagingView/SGPagingView.h
@@ -1,6 +1,6 @@
//
// SGPagingView.h
-// Version 1.6.6
+// Version 1.6.7
// GitHub:https://github.com/kingsic/SGPagingView
//
// Created by kingsic on 2016/10/6.
diff --git a/SGPagingViewExample.xcodeproj/project.pbxproj b/SGPagingViewExample.xcodeproj/project.pbxproj
index 9a1dd88..7fa0d12 100755
--- a/SGPagingViewExample.xcodeproj/project.pbxproj
+++ b/SGPagingViewExample.xcodeproj/project.pbxproj
@@ -54,6 +54,7 @@
8D5BB745213AC303000E929E /* ChildTempPopGestureVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D5BB744213AC303000E929E /* ChildTempPopGestureVC.m */; };
8D5BB749213AC570000E929E /* SGPagingViewPopGestureVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D5BB747213AC570000E929E /* SGPagingViewPopGestureVC.m */; };
8D5E68CF20F2FA140068044C /* DefaultAnimatedVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D5E68CE20F2FA140068044C /* DefaultAnimatedVC.m */; };
+ 8D69372622EC1E0200F91864 /* DefaultTopBottomVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D69372522EC1E0200F91864 /* DefaultTopBottomVC.m */; };
8DA4304120BBE3D600C47917 /* SGPageContentCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA4303F20BBE3D500C47917 /* SGPageContentCollectionView.m */; };
8DA4304420BBEDEC00C47917 /* UIButton+SGPagingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA4304320BBEDEC00C47917 /* UIButton+SGPagingView.m */; };
8DA4304720BBEF3B00C47917 /* DefaultImageVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA4304620BBEF3B00C47917 /* DefaultImageVC.m */; };
@@ -168,6 +169,8 @@
8D5BB748213AC570000E929E /* SGPagingViewPopGestureVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGPagingViewPopGestureVC.h; sourceTree = ""; };
8D5E68CD20F2FA140068044C /* DefaultAnimatedVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DefaultAnimatedVC.h; sourceTree = ""; };
8D5E68CE20F2FA140068044C /* DefaultAnimatedVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DefaultAnimatedVC.m; sourceTree = ""; };
+ 8D69372422EC1E0200F91864 /* DefaultTopBottomVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DefaultTopBottomVC.h; sourceTree = ""; };
+ 8D69372522EC1E0200F91864 /* DefaultTopBottomVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DefaultTopBottomVC.m; sourceTree = ""; };
8DA4303F20BBE3D500C47917 /* SGPageContentCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGPageContentCollectionView.m; sourceTree = ""; };
8DA4304020BBE3D600C47917 /* SGPageContentCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGPageContentCollectionView.h; sourceTree = ""; };
8DA4304220BBEDEC00C47917 /* UIButton+SGPagingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIButton+SGPagingView.h"; sourceTree = ""; };
@@ -356,6 +359,8 @@
8DF628F620A94CBA00B7B85A /* DefaultSystemVC.m */,
8DA4304520BBEF3B00C47917 /* DefaultImageVC.h */,
8DA4304620BBEF3B00C47917 /* DefaultImageVC.m */,
+ 8D69372422EC1E0200F91864 /* DefaultTopBottomVC.h */,
+ 8D69372522EC1E0200F91864 /* DefaultTopBottomVC.m */,
8D0F8E211FD95DE300F30426 /* DefaultGradientEffectVC.h */,
8D0F8E221FD95DE300F30426 /* DefaultGradientEffectVC.m */,
8D0F8E2F1FD95DE300F30426 /* DefaultZoomVC.h */,
@@ -588,6 +593,7 @@
8D0F8E6E1FD95E2300F30426 /* ChildVCSeven.m in Sources */,
8D5BB745213AC303000E929E /* ChildTempPopGestureVC.m in Sources */,
8D0F8E371FD95DE300F30426 /* DefaultStaticVC.m in Sources */,
+ 8D69372622EC1E0200F91864 /* DefaultTopBottomVC.m in Sources */,
182513D21F21CC340039F4A2 /* NavigationBarVC.m in Sources */,
8DCB02AA1F95B0FF00C9598A /* SGPageTitleViewConfigure.m in Sources */,
8D0F8E3A1FD95DE300F30426 /* DefaultZoomVC.m in Sources */,
diff --git a/SGPagingViewExample/MainVC/DefaultTopBottomVC.h b/SGPagingViewExample/MainVC/DefaultTopBottomVC.h
new file mode 100644
index 0000000..9ec638b
--- /dev/null
+++ b/SGPagingViewExample/MainVC/DefaultTopBottomVC.h
@@ -0,0 +1,17 @@
+//
+// DefaultTopBottomVC.h
+// SGPagingViewExample
+//
+// Created by kingsic on 2019/7/27.
+// Copyright © 2019年 Sorgle. All rights reserved.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface DefaultTopBottomVC : UIViewController
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SGPagingViewExample/MainVC/DefaultTopBottomVC.m b/SGPagingViewExample/MainVC/DefaultTopBottomVC.m
new file mode 100644
index 0000000..e55c827
--- /dev/null
+++ b/SGPagingViewExample/MainVC/DefaultTopBottomVC.m
@@ -0,0 +1,185 @@
+//
+// DefaultTopBottomVC.m
+// SGPagingViewExample
+//
+// Created by kingsic on 2019/7/27.
+// Copyright © 2019年 Sorgle. All rights reserved.
+//
+
+#import "DefaultTopBottomVC.h"
+#import "SGPagingView.h"
+#import "ChildVCOne.h"
+#import "ChildVCTwo.h"
+#import "ChildVCThree.h"
+#import "ChildVCFour.h"
+
+@interface DefaultTopBottomVC ()
+@property (nonatomic, strong) SGPageTitleView *pageTitleView;
+@property (nonatomic, strong) SGPageContentCollectionView *pageContentCollectionView;
+@property (nonatomic, strong) NSArray *titles;
+
+@end
+
+@implementation DefaultTopBottomVC
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ // Do any additional setup after loading the view.
+ self.view.backgroundColor = [UIColor whiteColor];
+ self.titles = @[@"精选\n猜你喜欢", @"大促爆款\n给你放大招", @"特价包邮\n幸福带回家", @"好店\n精选店铺"];
+ [self setupPageView];
+}
+
+- (void)setupPageView {
+ CGFloat statusHeight = CGRectGetHeight([UIApplication sharedApplication].statusBarFrame);
+ CGFloat pageTitleViewY = 0;
+ if (statusHeight == 20.0) {
+ pageTitleViewY = 64;
+ } else {
+ pageTitleViewY = 88;
+ }
+
+ SGPageTitleViewConfigure *configure = [SGPageTitleViewConfigure pageTitleViewConfigure];
+ configure.titleFont = [UIFont systemFontOfSize:17];
+ configure.indicatorStyle = SGIndicatorStyleFixed;
+
+ /// pageTitleView
+ self.pageTitleView = [SGPageTitleView pageTitleViewWithFrame:CGRectMake(0, pageTitleViewY, self.view.frame.size.width, 60) delegate:self titleNames:self.titles configure:configure];
+ [self.view addSubview:_pageTitleView];
+
+ // 这里只提供了案例并没对代码做处理;请根据项目需求进行代码抽取
+ [self attributedString];
+ [self attributedString1];
+ [self attributedString2];
+ [self attributedString3];
+
+ ChildVCOne *oneVC = [[ChildVCOne alloc] init];
+ ChildVCTwo *twoVC = [[ChildVCTwo alloc] init];
+ ChildVCThree *threeVC = [[ChildVCThree alloc] init];
+ ChildVCFour *fourVC = [[ChildVCFour alloc] init];
+ NSArray *childArr = @[oneVC, twoVC, threeVC, fourVC];
+ /// pageContentCollectionView
+ CGFloat ContentCollectionViewHeight = self.view.frame.size.height - CGRectGetMaxY(_pageTitleView.frame);
+ self.pageContentCollectionView = [[SGPageContentCollectionView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_pageTitleView.frame), self.view.frame.size.width, ContentCollectionViewHeight) parentVC:self childVCs:childArr];
+ _pageContentCollectionView.delegatePageContentCollectionView = self;
+ [self.view addSubview:_pageContentCollectionView];
+}
+
+- (void)pageTitleView:(SGPageTitleView *)pageTitleView selectedIndex:(NSInteger)selectedIndex {
+ [self.pageContentCollectionView setPageContentCollectionViewCurrentIndex:selectedIndex];
+}
+
+- (void)pageContentCollectionView:(SGPageContentCollectionView *)pageContentCollectionView progress:(CGFloat)progress originalIndex:(NSInteger)originalIndex targetIndex:(NSInteger)targetIndex {
+ [self.pageTitleView setPageTitleViewWithProgress:progress originalIndex:originalIndex targetIndex:targetIndex];
+}
+
+- (void)attributedString {
+ NSString *string = self.titles[0];
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
+ NSDictionary *normalDict = @{
+ NSForegroundColorAttributeName: [UIColor lightGrayColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:12]
+ };
+ NSRange normalRange = NSMakeRange(2, attributedString.length - 2);
+ [attributedString addAttributes:normalDict range:normalRange];
+
+
+ NSMutableAttributedString *selectedAttributedString = [[NSMutableAttributedString alloc] initWithString:string];
+ NSDictionary *selectedDict = @{
+ NSForegroundColorAttributeName: [UIColor redColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:12] };
+ NSRange selectedRange = NSMakeRange(0, selectedAttributedString.length);
+ [selectedAttributedString addAttributes:selectedDict range:selectedRange];
+ [selectedAttributedString addAttributes:@{
+ NSForegroundColorAttributeName: [UIColor redColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:17]
+ } range:NSMakeRange(0, 2)];
+
+ [_pageTitleView setAttributedTitle:attributedString selectedAttributedTitle:selectedAttributedString forIndex:0];
+}
+
+- (void)attributedString1 {
+ NSString *string = self.titles[1];
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
+ NSDictionary *normalDict = @{
+ NSForegroundColorAttributeName: [UIColor lightGrayColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:12]
+ };
+ NSRange normalRange = NSMakeRange(4, attributedString.length - 4);
+ [attributedString addAttributes:normalDict range:normalRange];
+
+
+ NSMutableAttributedString *selectedAttributedString = [[NSMutableAttributedString alloc] initWithString:string];
+ NSDictionary *selectedDict = @{
+ NSForegroundColorAttributeName: [UIColor redColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:12] };
+ NSRange selectedRange = NSMakeRange(0, selectedAttributedString.length);
+ [selectedAttributedString addAttributes:selectedDict range:selectedRange];
+ [selectedAttributedString addAttributes:@{
+ NSForegroundColorAttributeName: [UIColor redColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:17]
+ } range:NSMakeRange(0, 4)];
+
+ [_pageTitleView setAttributedTitle:attributedString selectedAttributedTitle:selectedAttributedString forIndex:1];
+}
+
+- (void)attributedString2 {
+ NSString *string = self.titles[2];
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
+ NSDictionary *normalDict = @{
+ NSForegroundColorAttributeName: [UIColor lightGrayColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:12]
+ };
+ NSRange normalRange = NSMakeRange(4, attributedString.length - 4);
+ [attributedString addAttributes:normalDict range:normalRange];
+
+
+ NSMutableAttributedString *selectedAttributedString = [[NSMutableAttributedString alloc] initWithString:string];
+ NSDictionary *selectedDict = @{
+ NSForegroundColorAttributeName: [UIColor redColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:12] };
+ NSRange selectedRange = NSMakeRange(0, selectedAttributedString.length);
+ [selectedAttributedString addAttributes:selectedDict range:selectedRange];
+ [selectedAttributedString addAttributes:@{
+ NSForegroundColorAttributeName: [UIColor redColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:17]
+ } range:NSMakeRange(0, 4)];
+
+ [_pageTitleView setAttributedTitle:attributedString selectedAttributedTitle:selectedAttributedString forIndex:2];
+}
+
+- (void)attributedString3 {
+ NSString *string = self.titles[3];
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
+ NSDictionary *normalDict = @{
+ NSForegroundColorAttributeName: [UIColor lightGrayColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:12]
+ };
+ NSRange normalRange = NSMakeRange(2, attributedString.length - 2);
+ [attributedString addAttributes:normalDict range:normalRange];
+
+
+ NSMutableAttributedString *selectedAttributedString = [[NSMutableAttributedString alloc] initWithString:string];
+ NSDictionary *selectedDict = @{
+ NSForegroundColorAttributeName: [UIColor redColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:12] };
+ NSRange selectedRange = NSMakeRange(0, selectedAttributedString.length);
+ [selectedAttributedString addAttributes:selectedDict range:selectedRange];
+ [selectedAttributedString addAttributes:@{
+ NSForegroundColorAttributeName: [UIColor redColor],
+ NSFontAttributeName : [UIFont systemFontOfSize:17]
+ } range:NSMakeRange(0, 2)];
+
+ [_pageTitleView setAttributedTitle:attributedString selectedAttributedTitle:selectedAttributedString forIndex:3];
+}
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+}
+*/
+
+@end
diff --git a/SGPagingViewExample/ViewController.m b/SGPagingViewExample/ViewController.m
index 8948205..2692e6c 100755
--- a/SGPagingViewExample/ViewController.m
+++ b/SGPagingViewExample/ViewController.m
@@ -11,6 +11,7 @@
#import "DefaultScrollVC.h"
#import "DefaultSystemVC.h"
#import "DefaultImageVC.h"
+#import "DefaultTopBottomVC.h"
#import "DefaultGradientEffectVC.h"
#import "DefaultZoomVC.h"
#import "DefaultFixedVC.h"
@@ -34,7 +35,7 @@ - (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
- self.TitleDataList = @[@"静止样式", @"滚动样式", @"系统样式", @"图片样式", @"文字渐变效果", @"文字缩放效果", @"指示器固定样式", @"指示器动态样式", @"指示器遮盖样式一", @"指示器遮盖样式二(从左到右自动布局)", @"指示器遮盖样式三", @"侧滑返回手势案例", @"滚动内容动画案例", @"AttributedTitle 属性案例", @"导航栏样式案例"];
+ self.TitleDataList = @[@"静止样式", @"滚动样式", @"系统样式", @"图片样式", @"文字上下样式(富文本)", @"文字渐变效果", @"文字缩放效果", @"指示器固定样式", @"指示器动态样式", @"指示器遮盖样式一", @"指示器遮盖样式二(从左到右自动布局)", @"指示器遮盖样式三", @"侧滑返回手势案例", @"滚动内容动画案例", @"富文本案例", @"导航栏样式案例"];
[self foundTableView];
}
@@ -75,42 +76,46 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
[self.navigationController pushViewController:imageVC animated:YES];
} else if (indexPath.row == 4) {
+ DefaultTopBottomVC *tbVC = [[DefaultTopBottomVC alloc] init];
+ [self.navigationController pushViewController:tbVC animated:YES];
+
+ } else if (indexPath.row == 5) {
DefaultGradientEffectVC *gradientEffectVC = [[DefaultGradientEffectVC alloc] init];
[self.navigationController pushViewController:gradientEffectVC animated:YES];
- } else if (indexPath.row == 5) {
+ } else if (indexPath.row == 6) {
DefaultZoomVC *zoomVC = [[DefaultZoomVC alloc] init];
[self.navigationController pushViewController:zoomVC animated:YES];
- } else if (indexPath.row == 6) {
+ } else if (indexPath.row == 7) {
DefaultFixedVC *fixedVC = [[DefaultFixedVC alloc] init];
[self.navigationController pushViewController:fixedVC animated:YES];
- } else if (indexPath.row == 7) {
+ } else if (indexPath.row == 8) {
DefaultDynamicVC *dynamicVC = [[DefaultDynamicVC alloc] init];
[self.navigationController pushViewController:dynamicVC animated:YES];
- } else if (indexPath.row == 8) {
+ } else if (indexPath.row == 9) {
DefaultCoverVC *coverVC = [[DefaultCoverVC alloc] init];
[self.navigationController pushViewController:coverVC animated:YES];
- } else if (indexPath.row == 9) {
+ } else if (indexPath.row == 10) {
DefaultTwoCoverVC *twoCoverVC = [[DefaultTwoCoverVC alloc] init];
[self.navigationController pushViewController:twoCoverVC animated:YES];
- } else if (indexPath.row == 10) {
+ } else if (indexPath.row == 11) {
DefaultThreeCoverVC *threeCoverVC = [[DefaultThreeCoverVC alloc] init];
[self.navigationController pushViewController:threeCoverVC animated:YES];
- } else if (indexPath.row == 11) {
+ } else if (indexPath.row == 12) {
DefaultPopGestureVC *popGestureVC = [[DefaultPopGestureVC alloc] init];
[self.navigationController pushViewController:popGestureVC animated:YES];
- } else if (indexPath.row == 12) {
+ } else if (indexPath.row == 13) {
DefaultAnimatedVC *animatedVC = [[DefaultAnimatedVC alloc] init];
[self.navigationController pushViewController:animatedVC animated:YES];
- } else if (indexPath.row == 13) {
+ } else if (indexPath.row == 14) {
DefaultAttributedTitleVC *attributedTitleVC = [[DefaultAttributedTitleVC alloc] init];
[self.navigationController pushViewController:attributedTitleVC animated:YES];