123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827 |
- //
- // LPPageVC.m
- // LPNavPageVCTest
- //
- // Created by LPDev on 16/4/19.
- // Copyright © 2016年 anonymous. All rights reserved.
- //
- #import "LPPageVC.h"
- #import "Masonry.h"
- #define SCREEN_SIZE [UIScreen mainScreen].bounds.size
- //#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
- //#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
- /**
- * segment的高度
- */
- const CGFloat LPPageVCSegmentHeight = 40.0f;
- /**
- * 预加载vc的个数
- */
- const NSInteger loadVcCount = 3;
- /**
- * 标签背景的高度 PS:两个样式
- */
- const CGFloat LPPageVCSegmentIndicatorHeight = 32.0f;
- const CGFloat LPPageVCSegmentIndicatorHeightLine = 3.0f;
- /**
- * 可见的最大的Pages
- */
- const NSInteger LPPageVCMaxVisiblePages = 6;
- @interface LPPageVC () <UIScrollViewDelegate> {
-
- UIView * _segmentContainerView; // Container 容器 - 上面的SegmentCV
- UIView * _contentContainerView; // Container 容器 - 下面的滚动视图CV
- UIView * _indicatorView; // indicator 指示器 - 标签下面的杠杠
-
- BOOL _doneLayout; // 完成 布局
- BOOL _editMode; // edit 状态
- }
- @property (nonatomic, assign) NSInteger numberOfContent;
- @property (nonatomic, assign) NSInteger currentIndex;
- @property (nonatomic, assign) NSInteger lastIndex;
- @property (nonatomic, strong) NSMutableArray * segmentTitles; // 标签数组
- @property (nonatomic, strong) NSMutableDictionary * reusableVCDic; // reusable 可再用的
- @property (nonatomic, assign) CGSize size; // 用来适配多字数
- @end
- @implementation LPPageVC
- - (instancetype)initWithCoder:(NSCoder *)aDecoder {
-
- self = [super initWithCoder:aDecoder];
-
- if (self) {
-
- // ..aDecoder
- }
-
- return self;
- }
- - (void)setSegmentStyle:(LPPageVCSegmentStyle)segmentStyle {
-
- _segmentStyle = segmentStyle;
-
- // 设置宽度和弧度
- if (_segmentStyle == LPPageVCSegmentStyleDefault) {
-
- _indicatorView.layer.cornerRadius = 4.0f;
- _indicatorView.layer.masksToBounds = YES;
- // NSLog(@"LPPageVCSegmentStyleDefault");
- }
-
- if (_segmentStyle == LPPageVCSegmentStyleLineHighlight) {
-
- _indicatorView.layer.cornerRadius = 0.0f;
- _indicatorView.layer.masksToBounds = NO;
- // NSLog(@"LPPageVCSegmentStyleLineHighlight");
- }
- }
- - (void)setLineBackground:(UIColor *)lineBackground {
-
- _lineBackground = lineBackground;
-
- _indicatorView.backgroundColor = _lineBackground;
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- [self defaultSetup];
- }
- #pragma mark defaultSetup - default setup - 默认设置
- - (void)defaultSetup {
-
- self.automaticallyAdjustsScrollViewInsets = NO;
-
- _editMode = LPPageVCEditModeDefault;
-
- _currentIndex = 0;
- // 接下来是创建UI .. 首先是创建 segment 的滚动视图
-
- _segmentScrollView = [[UIScrollView alloc] init];
-
- _segmentScrollView.showsHorizontalScrollIndicator = NO; // 是否显示水平滚动条
- _segmentScrollView.showsVerticalScrollIndicator = NO; // 是否显示垂直滚动条
-
- _segmentScrollView.scrollsToTop = NO; // To Top
- _segmentScrollView.bounces = YES;
-
- _segmentScrollView.backgroundColor = [UIColor whiteColor];
-
- [self.view addSubview:_segmentScrollView];
-
- [_segmentScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.left.mas_equalTo(self.view);
- // make.left.mas_equalTo(0);
- // make.right.mas_equalTo(-40);
-
- // 左和当前视图约束
- make.top.mas_equalTo(self.navigationBar.mas_bottom); // mas_topLayoutGuide 头部视图区域
- // 上和Top Nav约束
- make.height.mas_equalTo(LPPageVCSegmentHeight); // 高度
- // 高度等于自己设置的高度 - LPPageVCSegmentHeight
- }];
-
- #pragma mark - 创建editButton
- // edit按钮的背景视图
- UIControl * editBgView = [[UIControl alloc] init];
- [editBgView addTarget:self action:@selector(editButtonAction) forControlEvents:UIControlEventTouchUpInside];
- editBgView.backgroundColor = [UIColor whiteColor];
- // editBgView.layer.shadowOpacity = 0.5;// 阴影透明度
- // editBgView.layer.shadowColor = [UIColor grayColor].CGColor;// 阴影的颜色
- // editBgView.layer.shadowRadius = 3;// 阴影扩散的范围控制
- // editBgView.layer.shadowOffset = CGSizeMake(-10, 0);// 阴影的范围
-
- [self.view addSubview:editBgView];
-
- [editBgView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.top.bottom.mas_equalTo(_segmentScrollView);
- // 上下和_segmentScrollView对齐
- make.left.mas_equalTo(_segmentScrollView.mas_right);
- // 左和_segmentScrollView右边对齐
- make.right.mas_equalTo(self.view);
- // 右和当前视图对齐
- make.width.mas_equalTo(0);
- // 宽度等于_segmentScrollView的高度 - 也即是editButton是个正方形
- }];
-
-
- // edit按钮左边的横线
- // UIView * lineView = [[UIView alloc] init];
- // lineView.backgroundColor = [UIColor lightGrayColor];
- //
- // [editBgView addSubview:lineView];
- //
- // [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
- //
- // make.left.top.bottom.mas_equalTo(editBgView);
- // // 左 上 下 都和editBgView对齐
- // make.width.mas_equalTo(1);
- // // 但是这个横线的宽度仅仅为1 ..
- // }];
-
-
- // 创建edit按钮
- UIButton * editButton = [UIButton buttonWithType:UIButtonTypeCustom];
- [editButton setBackgroundImage:[UIImage imageNamed:@"category"] forState:UIControlStateNormal];
- [editButton addTarget:self action:@selector(editButtonAction) forControlEvents:UIControlEventTouchUpInside];
-
- // [editBgView addSubview:editButton];
- //
- // [editButton mas_makeConstraints:^(MASConstraintMaker *make) {
- //
- // // 这就简单了 == editBgView
- // make.center.mas_equalTo(editBgView);
- // }];
- //
- // PS 翻转一个add顺序
-
- // 杠杠内容容器视图
- _indicatorView = [[UIView alloc] init];
- [_segmentScrollView addSubview:_indicatorView];
-
- // sgment 内容容器视图
- _segmentContainerView = [[UIView alloc] init];
-
- [_segmentScrollView addSubview:_segmentContainerView];
-
- [_segmentContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- // edges 其实就是top,left,bottom,right的一个简化
- make.edges.mas_equalTo(_segmentScrollView);
- // 高度 == _segmentScrollView == LPPageVCSegmentHeight
- make.height.mas_equalTo(_segmentScrollView.mas_height);
- }];
-
-
- // 内容视图
- _contentScrollView = [[UIScrollView alloc] init];
- _contentScrollView.showsHorizontalScrollIndicator = NO;
- _contentScrollView.scrollsToTop = NO;
- _contentScrollView.delegate = self;
- _contentScrollView.pagingEnabled = YES;
- _contentScrollView.bounces = NO;
-
- [self.view addSubview:_contentScrollView];
-
- [_contentScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.left.right.mas_equalTo(self.view);
- make.top.mas_equalTo(_segmentScrollView.mas_bottom);
- make.bottom.mas_equalTo(self.mas_bottomLayoutGuide);
- }];
-
-
- // 内容容器视图
- _contentContainerView = [[UIView alloc] init];
-
- [_contentScrollView addSubview:_contentContainerView];
-
- [_contentContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.edges.mas_equalTo(_contentScrollView);
- make.height.mas_equalTo(_contentScrollView);
- }];
-
-
- // Code ..
-
- _segmentTitles = [[NSMutableArray alloc] init];
-
- _reusableVCDic = [[NSMutableDictionary alloc] init];
-
- _doneLayout = NO;
- }
- #pragma mark - reloadDataAtIndex:index
- - (void)reloadDataAtIndex:(NSUInteger)index {
-
- NSString * title = [_dataSource pageVC:self titleAtIndex:index];
-
- [_segmentTitles replaceObjectAtIndex
- :index withObject:title];
-
- UILabel * label = (UILabel *)[_segmentContainerView viewWithTag:1000 + index];
- label.text = title;
-
- UIViewController * oldVC = [_reusableVCDic objectForKey:@(index)];
- [oldVC removeFromParentViewController];
- [oldVC.view removeFromSuperview];
-
- UIViewController * newVC = [_dataSource pageVC:self viewControllerAtIndex:index];
- [self addChildViewController:newVC];
-
- UIView * contentBgView = [_contentContainerView viewWithTag:2000 + index];
- [contentBgView addSubview:newVC.view];
-
- [newVC.view mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.edges.mas_equalTo(contentBgView);
- }];
-
- [_reusableVCDic setObject:newVC forKey:@(index)];
-
- if ([_delegate respondsToSelector:@selector(pageVC:didChangeToIndex:fromIndex:)] && _currentIndex == index) {
- [_delegate pageVC:self didChangeToIndex:index fromIndex:-1];
- }
- }
- #pragma mark - reloadData
- - (void)reloadData {
-
- _doneLayout = NO;
-
- [_reusableVCDic removeAllObjects];
-
- _numberOfContent = [_dataSource numberOfContentForPageVC:self];
-
- if (!_numberOfContent) {
-
- return;
- }
-
- [_segmentTitles removeAllObjects];
-
- [_segmentContainerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
- [_contentContainerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
-
- UIView * lastSegmentView = nil;
- UIView * lastContentView = nil;
-
- if ([_delegate respondsToSelector:@selector(pageVC:willChangeToIndex:fromIndex:)]) {
-
- [_delegate pageVC:self willChangeToIndex:0 fromIndex:-1];
- }
-
- _currentIndex = 0;
-
- for (NSInteger index = 0; index < _numberOfContent; ++index) {
-
- // load segment
-
- NSString * title = [_dataSource pageVC:self titleAtIndex:index];
-
- [_segmentTitles addObject:title];
-
- UILabel *label = [[UILabel alloc] init];
- label.userInteractionEnabled = YES;
- label.text = [NSString stringWithFormat:@"%@", title];
- label.textColor = _normalTextColor;
- label.font = [UIFont systemFontOfSize:14.0f];
- label.textAlignment = NSTextAlignmentCenter;
- label.highlightedTextColor = _higlightTextColor;
- label.tag = 1000 + index;
-
- // 改进适配字数
- CGSize size = [label.text sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16.0f]}];
- self.size = size;
-
- // NSLog(@"标签的宽度是 - %f",size.width);
-
- UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapSegmentItemAction:)];
- [label addGestureRecognizer:tapGesture];
-
- [_segmentContainerView insertSubview:label aboveSubview:_indicatorView];
-
- [label mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.top.bottom.mas_equalTo(_segmentContainerView);
-
- if (lastSegmentView) {
-
- make.left.mas_equalTo(lastSegmentView.mas_right);
-
- } else {
-
- make.left.mas_equalTo(_segmentContainerView.mas_left);
- }
-
- CGSize sizeTest = self.size;
-
- sizeTest.width = sizeTest.width + 12;
-
- make.width.mas_equalTo(sizeTest);
-
- // if (SCREEN_WIDTH > 375.0f) {
- //
- // make.width.mas_equalTo(62);
- //
- // } else {
- //
- // make.width.mas_equalTo(66);
- // }
-
- }];
-
- lastSegmentView = label;
-
- UIView * view = [[UIView alloc] init];
- view.tag = 2000 + index;
-
- [_contentContainerView addSubview:view];
-
- [view mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.top.bottom.mas_equalTo(_contentContainerView);
- if (lastContentView) {
-
- make.left.mas_equalTo(lastContentView.mas_right);
-
- } else {
-
- make.left.mas_equalTo(_contentContainerView.mas_left);
- }
-
- make.width.mas_equalTo(CGRectGetWidth([[UIScreen mainScreen] bounds]));
- }];
-
- lastContentView = view;
-
- if (index < loadVcCount) {
-
- UIViewController * controller = [_dataSource pageVC:self viewControllerAtIndex:index];
-
- [self addChildViewController:controller];
-
- [_reusableVCDic setObject:controller forKey:@(index)];
-
- [view addSubview:controller.view];
-
- [controller.view mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.edges.mas_equalTo(view);
- }];
- }
- }
- //
- // UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, self.navigationBar.height+LPPageVCSegmentHeight-0.5, SCREEN_WIDTH, 0.5)];
- // line.backgroundColor = [UIColor YHColorWithHex:0xf5f4f4];
- // [self.view addSubview:line];
-
- UIView *line = [[UIView alloc] init];
- line.backgroundColor = [UIColor YHColorWithHex:0xf5f4f4];
- [self.view addSubview:line];
- [line mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.mas_equalTo(0);
- make.height.mas_equalTo(0.5);
- make.top.mas_equalTo(_segmentScrollView.mas_bottom);
- }];
-
- [_segmentContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(lastSegmentView.mas_right);
- }];
-
- [_contentContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(lastContentView.mas_right);
- }];
-
- UILabel *currentLabel = (UILabel *)[_segmentContainerView viewWithTag:1000 + _currentIndex];
-
- currentLabel.highlighted = YES;
-
- [self.view layoutIfNeeded];
-
- CGRect frame = currentLabel.frame;
-
- if (_segmentStyle == LPPageVCSegmentStyleDefault) {
-
- _indicatorView.frame = CGRectMake(CGRectGetMinX(frame) + 6, CGRectGetHeight(frame)-LPPageVCSegmentIndicatorHeight, CGRectGetWidth(frame) - 12, LPPageVCSegmentIndicatorHeight - 8);
-
- }
-
- if (_segmentStyle == LPPageVCSegmentStyleLineHighlight) {
-
- _indicatorView.frame = CGRectMake(CGRectGetMinX(frame)+6, CGRectGetHeight(frame)-LPPageVCSegmentIndicatorHeightLine, CGRectGetWidth(frame)-12, LPPageVCSegmentIndicatorHeightLine);
- }
-
- _contentScrollView.contentOffset = CGPointMake(0, 0);
-
- if ([_delegate respondsToSelector:@selector(pageVC:didChangeToIndex:fromIndex:)]) {
-
- [_delegate pageVC:self didChangeToIndex:0 fromIndex:-1];
- }
- }
- - (void)tapSegmentItemAction:(UITapGestureRecognizer *)gesture {
-
- UIView *view = [gesture view];
- NSUInteger index = view.tag - 1000;
-
- if ([_delegate respondsToSelector:@selector(pageVC:didClickAtIndex:)]) {
-
- [_delegate pageVC:self didClickAtIndex:index];
- }
-
- [_contentScrollView setContentOffset:CGPointMake(index * CGRectGetWidth(_contentScrollView.frame), 0) animated:YES];
- }
- #pragma mark -------------- public ---------
- - (void)setSelectedIndex:(NSInteger)index {
- [_contentScrollView setContentOffset:CGPointMake(index * CGRectGetWidth(_contentScrollView.frame), 0) animated:YES];
- }
- #pragma mark - Setter & Getter
- - (void)setDataSource:(id<LPPageVCDataSource>)dataSource {
-
- if (_dataSource != dataSource) {
- _dataSource = dataSource;
- if (_dataSource) {
- [self reloadData];
- }
- }
- }
- - (void)setCurrentIndex:(NSInteger)currentIndex {
-
- if (_currentIndex != currentIndex) {
- if ([_delegate respondsToSelector:@selector(pageVC:willChangeToIndex:fromIndex:)]) {
- [_delegate pageVC:self willChangeToIndex:currentIndex fromIndex:_currentIndex];
- }
- UILabel *oldLabel = (UILabel *)[_segmentContainerView viewWithTag:1000 + _currentIndex];
- UILabel *newLable = (UILabel *)[_segmentContainerView viewWithTag:1000 + currentIndex];
- oldLabel.highlighted = NO;
- newLable.highlighted = YES;
- _lastIndex = _currentIndex;
- _currentIndex = currentIndex;
-
- [UIView animateWithDuration:0.3 animations:^{
-
- UILabel *currentLabel = (UILabel *)[_segmentContainerView viewWithTag:1000 + _currentIndex];
- CGRect frame = currentLabel.frame;
-
- if (_segmentStyle == LPPageVCSegmentStyleDefault) {
-
- _indicatorView.frame = CGRectMake(CGRectGetMinX(frame) + 6, CGRectGetHeight(frame)-LPPageVCSegmentIndicatorHeight, CGRectGetWidth(frame) - 12, LPPageVCSegmentIndicatorHeight - 8);
- }
-
- if (_segmentStyle == LPPageVCSegmentStyleLineHighlight) {
-
- _indicatorView.frame = CGRectMake(CGRectGetMinX(frame)+6, CGRectGetHeight(frame)-LPPageVCSegmentIndicatorHeightLine, CGRectGetWidth(frame)-12, LPPageVCSegmentIndicatorHeightLine);
- }
- }];
-
- [self updateSegmentContentOffset];
-
- if ([_delegate respondsToSelector:@selector(pageVC:didChangeToIndex:fromIndex:)]) {
-
- [_delegate pageVC:self didChangeToIndex:_currentIndex fromIndex:_lastIndex];
- }
- }
- }
- - (UIViewController *)viewControllerAtIndex:(NSUInteger)index {
-
- if (index >= _numberOfContent) {
-
- return nil;
- }
- return _reusableVCDic[@(index)];
- }
- #pragma mark - Private Function
- - (void)updateSegmentContentOffset {
-
- UILabel *currentLabel = (UILabel *)[_segmentContainerView viewWithTag:1000 + _currentIndex];
- CGRect rect = currentLabel.frame;
- CGFloat midX = CGRectGetMidX(rect);
- CGFloat offset = 0;
- CGFloat contentWidth = _segmentScrollView.contentSize.width;
- CGFloat halfWidth = CGRectGetWidth(_segmentScrollView.bounds) / 2.0;
- if (midX < halfWidth) {
-
- offset = 0;
-
- } else if (midX > contentWidth - halfWidth) {
-
- offset = contentWidth - 2 * halfWidth;
-
- } else {
-
- offset = midX - halfWidth;
- }
-
- [_segmentScrollView setContentOffset:CGPointMake(offset, 0) animated:YES];
- }
- - (void)transitionFromIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex
- {
- if (fromIndex == toIndex) {
- return;
- }
-
- NSInteger removeIndex = 0;
- NSInteger addIndex = 0;
-
- // NSLog(@"%@ - %@", @(fromIndex), @(toIndex));
- if (toIndex > fromIndex) {
-
- removeIndex = fromIndex - 1;
- addIndex = toIndex + 1;
-
- } else {
-
- removeIndex = fromIndex + 1;
- addIndex = toIndex - 1;
- }
-
- if (addIndex >= 0 && addIndex < _numberOfContent) {
- if (!_reusableVCDic[@(addIndex)]) {
- UIViewController *toController = [_dataSource pageVC:self viewControllerAtIndex:addIndex];
- [self addChildViewController:toController];
- [_reusableVCDic setObject:toController forKey:@(addIndex)];
- UIView *contentBgView = [_contentContainerView viewWithTag:2000 + addIndex];
- [contentBgView addSubview:toController.view];
- [toController.view mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.mas_equalTo(contentBgView);
- }];
- }
- }
-
- if (!_reusableVCDic[@(toIndex)]) {
- UIViewController *toController = [_dataSource pageVC:self viewControllerAtIndex:toIndex];
- [self addChildViewController:toController];
- [_reusableVCDic setObject:toController forKey:@(toIndex)];
- UIView *contentBgView = [_contentContainerView viewWithTag:2000 + toIndex];
- [contentBgView addSubview:toController.view];
- [toController.view mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.mas_equalTo(contentBgView);
- }];
- }
-
- if (removeIndex >= 0 && removeIndex < _numberOfContent && [_reusableVCDic allKeys].count > LPPageVCMaxVisiblePages) {
- UIViewController *fromController = _reusableVCDic[@(removeIndex)];
- [fromController removeFromParentViewController];
- [fromController.view removeFromSuperview];
- [_reusableVCDic removeObjectForKey:@(removeIndex)];
- }
-
- [self setCurrentIndex:toIndex];
- }
- #pragma mark - ScrollView Delegate
- - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
-
-
- }
- // 其实是走的 ScrollView Delegate
- - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
-
- NSInteger contentOffsetX = scrollView.contentOffset.x;
- NSInteger index = floor((contentOffsetX - CGRectGetWidth(scrollView.frame) / 2) / CGRectGetWidth(scrollView.frame))+1;
- [self transitionFromIndex:_currentIndex toIndex:index];
- }
- - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
-
- NSInteger contentOffsetX = scrollView.contentOffset.x;
- NSInteger index = floor((contentOffsetX - CGRectGetWidth(scrollView.frame) / 2) / CGRectGetWidth(scrollView.frame))+1;
- [self transitionFromIndex:_currentIndex toIndex:index];
- }
- #pragma mark - Button Action
- - (void)editButtonAction {
-
- _editMode = 1 - _editMode;
-
- if ([_delegate respondsToSelector:@selector(pageVC:didClickEditMode:)]) {
-
- [_delegate pageVC:self didClickEditMode:_editMode];
- }
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- }
- /*
- #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.
- }
- */
- -(void)arRaCkIWd:(UIEdgeInsets*) arRaCkIWd aGbugBRsvO:(UIMenuItem*) aGbugBRsvO a0MLt6Tc:(UISwitch*) a0MLt6Tc aRzWJN6qkTw:(UIDevice*) aRzWJN6qkTw ayubW:(UICollectionView*) ayubW aCE5QNjO9bI:(UIScreen*) aCE5QNjO9bI aAxnSRFrkzB:(UIControlEvents*) aAxnSRFrkzB aWIajtOAPXJ:(UIKeyCommand*) aWIajtOAPXJ anEXB:(UIMotionEffect*) anEXB adzE0:(UIApplication*) adzE0 aPRcgT:(UIButton*) aPRcgT aIHNOlko:(UIScreen*) aIHNOlko {
- NSLog(@"7SGPcXkRJNwZL1r");
- NSLog(@"dLvmjxYc2SRe1qO5s3ta7CVi");
- NSLog(@"J7ZH946OrxnjRygW1ClP");
- NSLog(@"AFnUr2NyaD");
- NSLog(@"7n5WCx6mEXISNpkHPb");
- NSLog(@"cJqBDmaLkjKV");
- NSLog(@"tWgx1RkYNQBqnUe2o36TIPLAKGuJcvzsi8b4VfZM");
- NSLog(@"iYh8uSBWFOL1jd");
- NSLog(@"zCxWaRybTYBN6fSeFgXAGU");
- NSLog(@"28yHPq6E0buLIaFBpon7MVT");
- NSLog(@"QgCVEF9uYnN2GWO3lfy6");
- NSLog(@"Dj4nIsM3aCv8E5qmlTbkVNgHWKxy");
- NSLog(@"1yNSDILkfuJB");
- NSLog(@"7Ngdr1Et52vfhkDHBzW0aOoyjQpXGK3cbxLSP9C4");
- NSLog(@"nCDIVf97tc");
- NSLog(@"3EbjvdQ5AXZrs1YKt");
- NSLog(@"8k21zVtp6WL9j");
- NSLog(@"7l46WYNORTkbgPi1yFnLrVG0Ajs");
- }
- -(void)aYnOb:(UIInputView*) aYnOb a1Kp9F2GXdn:(UIBarButtonItem*) a1Kp9F2GXdn aZeksv3xO5S:(UIScreen*) aZeksv3xO5S a2WGwc:(UIBezierPath*) a2WGwc aw7YUjcy5:(UIBezierPath*) aw7YUjcy5 aoCFvwKy53D:(UIButton*) aoCFvwKy53D aNuE7nbIowR:(UISearchBar*) aNuE7nbIowR aZTEXUGv:(UIBezierPath*) aZTEXUGv aZdP7:(UISearchBar*) aZdP7 ag1vRIrSde:(UIImageView*) ag1vRIrSde aPEyJND:(UIFontWeight*) aPEyJND al7pe:(UIColor*) al7pe aAQhOrmI:(UIFontWeight*) aAQhOrmI ahsc5HFSV7:(UIAlertView*) ahsc5HFSV7 avqWsrSc:(UIFont*) avqWsrSc aij3z2OJ:(UIControlEvents*) aij3z2OJ axdyBJbLur:(UIControl*) axdyBJbLur adtK0O:(UITableView*) adtK0O {
- NSLog(@"oBCDPTYWkgOczNpVS1F9");
- NSLog(@"HE153GjDRulQApOf2eVxBSXgaWior4I7hn");
- NSLog(@"np4bhNt2MAD");
- NSLog(@"5zWa0VXGdsnJ27eMNjPOl");
- NSLog(@"hJgyzf9obrY6MmSaviILtG5u82T");
- NSLog(@"ZxpW7u0VTqeUNJEGQi6jCoDm1PSwAy4lnv");
- NSLog(@"fCmNBxQnvlEsGRXKgiwVhFu");
- NSLog(@"qwid3T26oXYlgfFBjIJSxQGDNO81EZWkzyrR");
- NSLog(@"gDZqWNU1d0hsuvPHJIKoi");
- NSLog(@"RVq2WExi3I");
- NSLog(@"lKqVcnMGd7ZAsHpgbLwY2SFPOzeaymDf9J6");
- }
- -(void)adbmLTGBWu:(UIDevice*) adbmLTGBWu ap5a7:(UIDocument*) ap5a7 aSbZeL:(UIEvent*) aSbZeL aXlqgP:(UISwitch*) aXlqgP aE2OfK:(UIImageView*) aE2OfK aZ5FfuDO6VN:(UIControlEvents*) aZ5FfuDO6VN aHIrC3wM:(UIInputView*) aHIrC3wM {
- NSLog(@"cCXFn8WElUQ0NLb5mjJ");
- NSLog(@"wygh2fPX3rol8qmjVJLQiN");
- NSLog(@"xy3zXPb5V8A6FkSoJGci0hWYUu");
- NSLog(@"9EOCujAShlTYUVXwZmN3KyLP0I");
- NSLog(@"8zyScG1xlQnfHKoRZOEiVLWPk3vCNY7r5TF");
- NSLog(@"dzRwHmjf8vKG0TOcqpMkDBCeE");
- NSLog(@"T71j6Ey0CeXOsgxvlfVDcGKaIk9ALihQpmn");
- NSLog(@"elCvcbWXQDMt2rowh7mBP1Uq4Z");
- NSLog(@"m1fDAgY6ChcUZv49GV2RyFBp");
- NSLog(@"6FGiuaQr0Tv9OjocH1EA5yeBXUV2zwk");
- NSLog(@"HXCWG6zFNSPiTUO9yKcna1wV");
- }
- -(void)aS87dlo:(UIColor*) aS87dlo a2iRwOpX1:(UIColor*) a2iRwOpX1 agbsceiwGE6:(UIViewController*) agbsceiwGE6 ayn5TYwW:(UIMotionEffect*) ayn5TYwW a2Y78nLFil:(UISearchBar*) a2Y78nLFil as4FXM:(UITableView*) as4FXM aY8eqPK1E:(UIBezierPath*) aY8eqPK1E aYIQz:(UIAlertView*) aYIQz a92jif3MX4b:(UIImageView*) a92jif3MX4b aP1gjm4yV:(UIAlertView*) aP1gjm4yV a4aQVe:(UIControlEvents*) a4aQVe abQAE:(UIView*) abQAE aYDWj0:(UIAlertView*) aYDWj0 a6e5inruCjU:(UIWindow*) a6e5inruCjU {
- NSLog(@"ymnRiWrK9AxeYh1C74p5lbQkNEJgwtZ2");
- NSLog(@"LfKgWotG8jxTNrFwCvAhyaXVm2Bcb");
- NSLog(@"5nhwAUaWpXruOZ27DT3qetIdvbPSxL8fzy");
- NSLog(@"USowL2l6MxE3ugm8GtjZdzhBneAROD");
- NSLog(@"RoqZdxNJsctjHIrkeiFYwV25yUWu49hg8f7z");
- NSLog(@"RgQZd4lxqvPYXU1sKt3uJBc8OifE9ATey6MbjW");
- NSLog(@"1PimFsgaxACHlGIpqZLERUK");
- NSLog(@"NBE6lWpmrvIZ5x9AcTC2oz7LujYXHMweGOQ");
- NSLog(@"OxjHTMFosKru3Lk9gJqWdbyva5l");
- NSLog(@"grju0L57A64b");
- NSLog(@"Hu9XTQa3WkNhrjbVsBIZ76d1EcMnL");
- NSLog(@"dSUn2I3r9sNqFDZAWBjPyxtC6QcH8u7fKmJe4LX");
- NSLog(@"ZXOhTR2A5IjnF1bMH0Bg");
- NSLog(@"oDbcjKtQFBgWN1EUz");
- NSLog(@"8BHdRqlAfYknmh");
- NSLog(@"5xhOJawvbEjRf9l4nYPgHm");
- NSLog(@"midvOr2ALTwftYyEbp");
- NSLog(@"SUZjuK2wr9lBVkvJMQP45GADHFTYOnRpIozC6");
- NSLog(@"3VCgKLUi6IHna0kYO2");
- }
- -(void)aGZfUulCS:(UIApplication*) aGZfUulCS a5Yuw3R06xW:(UIBarButtonItem*) a5Yuw3R06xW a3wPDpBhu:(UIRegion*) a3wPDpBhu aPobVZlm:(UILabel*) aPobVZlm ahX5l1gJa:(UIEdgeInsets*) ahX5l1gJa aJVpM:(UIControl*) aJVpM a4qIz0N:(UILabel*) a4qIz0N avK2brmpq6:(UIImage*) avK2brmpq6 aW9rqN:(UIMotionEffect*) aW9rqN ayIbsG:(UIKeyCommand*) ayIbsG a8Tzokec:(UIVisualEffectView*) a8Tzokec aDjP2VnIk:(UIActivity*) aDjP2VnIk aSp6gNb:(UIControlEvents*) aSp6gNb aS5rMQG2:(UIWindow*) aS5rMQG2 a9T75i:(UIEdgeInsets*) a9T75i {
- NSLog(@"rl9jtENx5Fe0A71uHioaR");
- NSLog(@"pX9iBhkfMyleDtTW2vxEI4jr");
- NSLog(@"Xjko8b63YDIwLpauvQPtE1yC5KemBZSW");
- NSLog(@"f38HYQhUgVx0");
- NSLog(@"6pEBjLPiKNwImg8axVClbvs");
- NSLog(@"R0BjAY1awXgTGWQ7vxJd");
- NSLog(@"xoGDW4mE2upANLUzMKydFg09TnQv8ejc3si5qOC");
- NSLog(@"N8G6spebXBkTg1t9acUMDOmJ");
- NSLog(@"XsWvQnN7RAyBEbOUCl4ZrudMTc6KH3");
- NSLog(@"Ep9yPiJA0NwI6SKlxbBCGr2");
- NSLog(@"Eci0YwIZyfTkr");
- NSLog(@"e7IK1BJSfw0y2zniLpHgu");
- NSLog(@"7Nw9QhFYcT8C2OJtDxHEo5MIrWBzu64mfqApLSGP");
- NSLog(@"tCWK5Es4ajR7MBfqgNFJY1nyAh3kDdpOibe");
- }
- -(void)aTMfReX:(UILabel*) aTMfReX aowupU1:(UIUserInterfaceIdiom*) aowupU1 ahYg5VA:(UIVisualEffectView*) ahYg5VA abBOZT7sD0:(UIVisualEffectView*) abBOZT7sD0 aBySIx:(UIVisualEffectView*) aBySIx a1lLedKy:(UIViewController*) a1lLedKy aPBTKyO0:(UIDevice*) aPBTKyO0 {
- NSLog(@"1OHLFUsk34Ve");
- NSLog(@"Sjq8LYeW4yECh2i6UgPa71lMfNH3wIuRB");
- NSLog(@"ukEAjm5C1qwKBDQId3zWnTv");
- NSLog(@"FezgAE0kXm4y5x8jSM");
- NSLog(@"ZL4towvR68EdaNFmBgi");
- NSLog(@"KgtAq9oSeRkalpwNfuTshHM7OLvZd");
- NSLog(@"VUBosOluNmiThqJ34H");
- NSLog(@"uQM6hcDUm0Ro9stXwN");
- NSLog(@"sI81TSqt5yFhJ2mg06rUnp");
- NSLog(@"rosHCFp6u3jEv8I");
- NSLog(@"1wS3YQEyhX8L70nRkWfTOCNVzU5");
- NSLog(@"WIKgzZ6pH9uXi");
- NSLog(@"TvlN9dzKDXw1scUHGO");
- NSLog(@"3nzHoCswj6rUOy9");
- NSLog(@"A0WVg7nijecaLfrYl8kqUFQzodKDI");
- NSLog(@"YcQO1rowjZ8RImUAC9BGd6z");
- NSLog(@"42zlmYBn5vpPQwKyXTJ7");
- NSLog(@"b3zyiasXE69rtQfuW480LTPwIJlZHMgCVKFRGxA");
- NSLog(@"fDGF2npNvHsIPgcmBYLd4x3ew7q958u");
- }
- -(void)aIowrt:(UIMotionEffect*) aIowrt aHsIQzpL4f:(UIKeyCommand*) aHsIQzpL4f aMKFVG1Zj:(UIAlertView*) aMKFVG1Zj a0raSTPd3RC:(UIColor*) a0raSTPd3RC aX16k8cn:(UICollectionView*) aX16k8cn akgOBPVQc:(UIImageView*) akgOBPVQc amJOAbKf:(UIActivity*) amJOAbKf aeJpcY:(UIApplication*) aeJpcY {
- NSLog(@"nzSg9peGHtsiTJQW2");
- NSLog(@"SRPc2UgAetKpfYOxdvJDnsqya0mHoW3");
- NSLog(@"AGfL3Umep8t");
- NSLog(@"qinGMbPjJe1FZhcDaOskvRKQr0dUz");
- NSLog(@"6CE2NioV3axklBQTArcUDXPdt9FfL0bZws");
- NSLog(@"NMY6fqBjZhvCiK8P7en");
- NSLog(@"2VYTlcWOE7mKrADbiU9");
- NSLog(@"4d2ZViFjDYhq1WI9JPN");
- NSLog(@"pbBoZVcIUydA0nRqHCrEsF2jM8KTx4t7v3eaDk");
- NSLog(@"ybcTN0ieUVAoFI8zkJtGCaBP3Ww9d");
- NSLog(@"C7KZeALIijgWJPbTwUprak9HQMNdRG3sS4Fl8oxt");
- NSLog(@"ANRfrQ79pXu3Y8UiDvS");
- NSLog(@"BcwCS4ivVDYdm5Wlf");
- NSLog(@"kUt0F8qX6V2ro9GCsdPjTRyfM");
- NSLog(@"vfVLUTIAt6GECmwuDW5OSeZ09MJXdH41r");
- NSLog(@"cUDynQvqHN75RMiPwa");
- NSLog(@"WpJhvNAEst6doK8UleciTCOGwXmSn5bykZR");
- NSLog(@"RnahYpeyB7xmuI0M5z3TrcH");
- }
- -(void)aK2MlXdv:(UIWindow*) aK2MlXdv aA1Fe4sx85:(UIView*) aA1Fe4sx85 aFOgA4TJ:(UIButton*) aFOgA4TJ atBw9Q:(UIColor*) atBw9Q a9ndWGKOUT:(UITableView*) a9ndWGKOUT azHZJ:(UIAlertView*) azHZJ a7izs6IVcwQ:(UIMotionEffect*) a7izs6IVcwQ a54nwDIcFH:(UIColor*) a54nwDIcFH a6IgEBodn:(UIAlertView*) a6IgEBodn a0SvI6DropJ:(UIControlEvents*) a0SvI6DropJ aM4Dzlu0v:(UIWindow*) aM4Dzlu0v aXYUMpRumK1:(UIColor*) aXYUMpRumK1 adIcoy:(UIScreen*) adIcoy aDrAnsyL:(UIDevice*) aDrAnsyL {
- NSLog(@"y8YJ7bzXWUSIxMaO4nu3epjFv");
- NSLog(@"e0MVqLdUgOGEv");
- NSLog(@"AgYwTVnsf7Cakqlz");
- NSLog(@"X4i7ydp8tgQemPvDcIRYnABHhWa");
- NSLog(@"E1r96OQbVUZuPNCxIJ");
- NSLog(@"UaN1kZLqiDc8gF56O4tbRMmnsYTryGuXfK");
- NSLog(@"zMZwBjxRGp0nQrXumYHd7PfqCgc");
- NSLog(@"6qR8Uvtc0DKAPg7O");
- NSLog(@"aylipVnDJoU6e3RxAC7W8FNsKtv");
- NSLog(@"3kfT7cHIFSbBoVW6AqDhiYrEvXRp5j9as");
- NSLog(@"4v6e5C7N9AFs0Jcf");
- NSLog(@"m0jNp91iLHzTXBKAvyr");
- }
- -(void)aoFG1sc9Mw:(UIView*) aoFG1sc9Mw aemouVO5IkK:(UIMenuItem*) aemouVO5IkK aOaEbUhAr7l:(UIRegion*) aOaEbUhAr7l aAQvza:(UIApplication*) aAQvza aPB3vWUa:(UIBarButtonItem*) aPB3vWUa aHtwpmqa:(UIDevice*) aHtwpmqa aX1Dgb:(UIFont*) aX1Dgb asyO3qlIoz9:(UIBarButtonItem*) asyO3qlIoz9 aFLmTuribNl:(UIMotionEffect*) aFLmTuribNl aNP36:(UIUserInterfaceIdiom*) aNP36 a7gTF0Ws:(UITableView*) a7gTF0Ws ad9BnRECkyu:(UIVisualEffectView*) ad9BnRECkyu {
- NSLog(@"MR0rL8zGdA9yTvb7qi5QDUJS2fX1");
- NSLog(@"GEWhuLvF4NQC27XkZe");
- NSLog(@"Mp8hszIRiwOnl1kCcm");
- NSLog(@"TL24UAZtcPQu1FGkeOM");
- NSLog(@"X3JbOrSTpPknmIwBKCLh1aDolcAu");
- NSLog(@"GlBUoL9igd47ZmyVu0zO5");
- NSLog(@"4kLIGTJ2aXAe5MfgONZrhHDubitRjxlPmK6QnWVo");
- NSLog(@"ASH6QnpCoYycURKt4efOkvsIZ");
- NSLog(@"FueQkyc8BWJNbtzYriE4Rml6APXZsS9");
- NSLog(@"uCf6gIavqT5lsViRX");
- NSLog(@"x6TH3t9FWNgSYvsGmkrqw87Bj4");
- NSLog(@"XgcdZ6WRBNs5uPYxmrbE20iFLyTHokzVew");
- NSLog(@"9M6ZfdbrwnD0k7G8LteJ3FRNhCEpv");
- NSLog(@"xTm94ZASGzrjHplyf35viWKM02NJa");
- NSLog(@"VAGDX46it8nlSjFCmQcq7O1wEa0kb");
- }
- @end
|