Skip to content

Commit

Permalink
【Releases 1.5.5】
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsic committed Sep 26, 2018
1 parent ab46e12 commit 8b499b1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 61 deletions.
59 changes: 13 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,6 @@

#### [Swift Version](https://github.com/kingsic/SGPagingView-Swift)

#### iOS技术交流群:429899752


## 目录

* [结构图](#结构图)

* [效果图](#效果图)

* [主要内容的介绍](#主要内容的介绍)

* [Installation](#Installation)

* [代码介绍](#代码介绍)

* [问题及解决方案](#问题及解决方案)

* [版本介绍](#版本介绍)

* [Concluding remarks](#Concluding_remarks)


## 结构图
![](https://github.com/kingsic/SGPagingView/raw/master/Picture/SGPagingView.png)
Expand All @@ -43,7 +22,7 @@ SGPageContentCollectionView(内部由 UICollectionView 实现)
![](https://github.com/kingsic/SGPagingView/raw/master/Picture/sorgle.gif)


## 主要内容的介绍
## 主要内容介绍
* `系统样式`<br>

* `图片样式`<br>
Expand All @@ -66,7 +45,7 @@ SGPageContentCollectionView(内部由 UICollectionView 实现)


## Installation
* 1、CocoaPods 导入 pod 'SGPagingView', '~> 1.5.3'
* 1、CocoaPods 导入 pod 'SGPagingView', '~> 1.5.5'
* 2、下载、拖拽 “SGPagingView” 文件夹到工程中


Expand Down Expand Up @@ -100,27 +79,6 @@ SGPageContentCollectionView(内部由 UICollectionView 实现)
```


#### SGPagingView 的介绍
|主要属性、方法|描述|
|----|-----|
|**selectedIndex**|选中标题下标|
|**resetSelectedIndex**|重置标题下标|
|**titleFont**|标题文字字号大小,默认 15 号字体|
|**titleColor**|普通状态下标题按钮文字的颜色,默认为黑色|
|**titleSelectedColor**|选中状态下标题按钮文字的颜色,默认为红色|
|**indicatorColor**|指示器颜色,默认为红色|
|**indicatorStyle**|指示器样式,默认为下划线样式;下划线、遮盖样式|
|**indicatorHeight**|指示器高度;下划线样式下默认为 2.f,遮盖样式下,默认为标题文字的高度,若大于 SGPageTitleView,则高度为 SGPageTitleView 高度,下划线样式未做处理|
|**indicatorAdditionalWidth**|指示器遮盖、下划线样式下额外增加的宽度,默认为 0.0f;介于标题文字宽度与按钮宽度之间|
|**titleAdditionalWidth**|标题额外增加的宽度,默认为 20.0f|
|**indicatorStyle**|指示器样式;SGIndicatorStyleDefault、SGIndicatorStyleCover、SGIndicatorStyleFixed、SGIndicatorStyleDynamic(仅在 SGIndicatorScrollStyleDefault 样式下支持)|
|**indicatorCornerRadius**|圆角属性,默认为 0.f;若圆角大于 1/2 指示器高度,则圆角大小为指示器高度的 1/2|
|**indicatorScrollStyle**|指示器滚动样式|
|**resetTitle:forIndex:**|根据标题下标值重置标题文字|
|**setAttributedTitle:selectedAttributedTitle:forIndex:**|根据标题下标值设置标题的 attributedTitle 属性|
|**setImages:selectedImages:imagePositionType:spacing:**|设置图片及样式|


## 问题及解决方案
### 一、CocoaPods 安装 SGPagingView 时,遇到的问题及解决方案
* 若在使用 CocoaPods 安装 SGPagingView 时,出现 [!] Unable to find a specification for SGPagingView 提示时,打开终端先输入 pod repo remove master;执行完毕后再输入 pod setup 即可 (可能会等待一段时间)
Expand Down Expand Up @@ -192,7 +150,16 @@ b. 实现 SGPageContentScrollView 的 pageContentScrollView:index:代理方法

* 2018-09-01 :v1.5.3 SGPageTitleView 内部代码优化以及新增 SGPagingViewPopGestureVC 用于解决侧滑返回手势

* 2018-09-26 :v1.5.5 标题文字缩放效果由文字缩放调整为控件缩放


## Author

* Email:[email protected]

* QQ群:(付费群)<br>
![](https://github.com/kingsic/Kar98k/blob/master/Source/QQGroup_qrcode.png)

## Concluding remarks

* 如在使用中, 遇到什么问题或有更好建议者, 请记得 [Issues me](https://github.com/kingsic/SGPagingView/issues)[email protected] 邮箱联系我
## License
SGPagingView is released under the MIT license. See [LICENSE](https://github.com/kingsic/SGPagingView/blob/master/LICENSE) for details.
2 changes: 1 addition & 1 deletion SGPagingView.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = 'SGPagingView'
s.version = '1.5.3'
s.version = '1.5.5'
s.summary = 'A powerful and easy to use segment control'
s.homepage = 'https://github.com/kingsic/SGPagingView'
s.license = 'MIT'
Expand Down
8 changes: 4 additions & 4 deletions SGPagingView/SGPageContent/SGPageContentCollectionView.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ @interface SGPageContentCollectionView () <UICollectionViewDataSource, UICollect
/// 记录加载的上个子控制器的下标
@property (nonatomic, assign) NSInteger previousCVCIndex;
/// 标记内容滚动
@property (nonatomic, assign) BOOL isScrll;
@property (nonatomic, assign) BOOL isScroll;
@end

@implementation SGPageContentCollectionView
Expand Down Expand Up @@ -106,14 +106,14 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
#pragma mark - - - UIScrollViewDelegate
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
_startOffsetX = scrollView.contentOffset.x;
_isScrll = YES;
_isScroll = YES;
if (self.delegatePageContentCollectionView && [self.delegatePageContentCollectionView respondsToSelector:@selector(pageContentCollectionViewWillBeginDragging)]) {
[self.delegatePageContentCollectionView pageContentCollectionViewWillBeginDragging];
}
}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
_isScrll = NO;
_isScroll = NO;
CGFloat offsetX = scrollView.contentOffset.x;
// 1、记录上个子控制器下标
_previousCVCIndex = offsetX / scrollView.frame.size.width;
Expand All @@ -128,7 +128,7 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (_isAnimated == YES && _isScrll == NO) {
if (_isAnimated == YES && _isScroll == NO) {
return;
}
// 1、定义获取需要的数据
Expand Down
8 changes: 4 additions & 4 deletions SGPagingView/SGPageContent/SGPageContentScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ @interface SGPageContentScrollView () <UIScrollViewDelegate>
/// 记录加载的上个子控制器的下标
@property (nonatomic, assign) NSInteger previousCVCIndex;
/// 标记内容滚动
@property (nonatomic, assign) BOOL isScrll;
@property (nonatomic, assign) BOOL isScroll;
@end

@implementation SGPageContentScrollView
Expand Down Expand Up @@ -80,14 +80,14 @@ - (UIScrollView *)scrollView {
#pragma mark - - - UIScrollViewDelegate
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
_startOffsetX = scrollView.contentOffset.x;
_isScrll = YES;
_isScroll = YES;
if (self.delegatePageContentScrollView && [self.delegatePageContentScrollView respondsToSelector:@selector(pageContentScrollViewWillBeginDragging)]) {
[self.delegatePageContentScrollView pageContentScrollViewWillBeginDragging];
}
}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
_isScrll = NO;
_isScroll = NO;
// 1、根据标题下标计算 pageContent 偏移量
CGFloat offsetX = scrollView.contentOffset.x;
// 2、切换子控制器的时候,执行上个子控制器的 viewWillDisappear 方法
Expand Down Expand Up @@ -138,7 +138,7 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (_isAnimated == YES && _isScrll == NO) {
if (_isAnimated == YES && _isScroll == NO) {
return;
}
// 1、定义获取需要的数据
Expand Down
8 changes: 4 additions & 4 deletions SGPagingView/SGPageTitle/SGPageTitleViewConfigure.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ typedef enum : NSUInteger {
/** 指示器滚动位置改变样式,默认为 SGIndicatorScrollStyleDefault */
@property (nonatomic, assign) SGIndicatorScrollStyle indicatorScrollStyle;

#pragma mark - - 按钮之间分割线属性
/** 是否显示按钮之间的分割线,默认为 NO */
#pragma mark - - 标题间分割线属性
/** 是否显示标题间分割线,默认为 NO */
@property (nonatomic, assign) BOOL showVerticalSeparator;
/** 按钮之间的分割线颜色,默认为红色 */
/** 标题间分割线颜色,默认为红色 */
@property (nonatomic, strong) UIColor *verticalSeparatorColor;
/** 按钮之间的分割线额外减少的高度,默认为 0.0f */
/** 标题间分割线额外减少的高度,默认为 0.0f */
@property (nonatomic, assign) CGFloat verticalSeparatorReduceHeight;

#pragma mark - - badge 相关属性
Expand Down
2 changes: 1 addition & 1 deletion SGPagingView/SGPageTitle/SGPageTitleViewConfigure.m
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ - (CGFloat)indicatorDynamicWidth {
return _indicatorDynamicWidth;
}

#pragma mark - - 按钮之间分割线属性
#pragma mark - - 标题间分割线属性
- (UIColor *)verticalSeparatorColor {
if (!_verticalSeparatorColor) {
_verticalSeparatorColor = [UIColor redColor];
Expand Down
2 changes: 1 addition & 1 deletion SGPagingView/SGPagingView.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// GitHub:https://github.com/kingsic/SGPagingView
//
// SGPagingView.h
// Version 1.5.4
// Version 1.5.5
//
// Created by kingsic on 2016/10/6.
// Copyright © 2016年 kingsic. All rights reserved.
Expand Down

0 comments on commit 8b499b1

Please sign in to comment.