Skip to content

Commit

Permalink
config WyhPageControl code.
Browse files Browse the repository at this point in the history
  • Loading branch information
wyh committed Aug 17, 2018
1 parent 2c13fe0 commit 15ea35c
Show file tree
Hide file tree
Showing 30 changed files with 1,938 additions and 0 deletions.
73 changes: 73 additions & 0 deletions WyhPageControl/WyhPageControl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
// WyhPageControl.h
// NewPagedFlowViewDemo
//
// Created by wyh on 2018/8/16.
// Copyright © 2018年 robertcell.net. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "WyhPageControlDot.h"

@class WyhPageControl;

@protocol WyhPageControlDataSource <NSObject>

@optional

- (WyhPageControlDot *)pageControl:(WyhPageControl *)pageControl dotForIndex:(NSInteger)index;

@end

@protocol WyhPageControlDelegate <NSObject>

@optional
- (void)pageControl:(WyhPageControl *)pageControl didClickForIndex:(NSInteger)index;

@end



@interface WyhPageControl : UIView

@property (nonatomic, assign) NSUInteger numberOfPages; // default is 0
@property (nonatomic, assign) NSInteger currentPage; // default is 0. value pinned to 0..numberOfPages-1

@property (nonatomic, assign) BOOL hidesForSinglePage; // hide the the indicator if there is only one page. default is NO

@property(nonatomic, strong) UIColor *pageIndicatorTintColor;

@property(nonatomic, strong) UIColor *currentPageIndicatorTintColor;

@property (nonatomic, assign) CGFloat dotLeftMargin; // distance left and right outside.

@property (nonatomic, assign) CGFloat dotTopMargin; // distance top and bottom outside.

@property (nonatomic, assign) CGFloat dotSpace; //distance between each dot.

@property (nonatomic, strong) UIImage *backgroundImage; //background image.

@property (nonatomic, strong) UIColor *backgroundColor; //background color.

@property (nonatomic, strong) UIColor *borderColor; //pageControl's border-color.

@property (nonatomic, assign) CGFloat borderWidth; // pageControl's border width.

@property (nonatomic, assign) CGFloat cornerRadius; // pageControl's cornerRadius.

@property (nonatomic, assign) BOOL showReloadActivityIndicator; // Whether show activity indicator when reloadData, default is YES.

- (instancetype)initWithDataSource:(id<WyhPageControlDataSource>)dataSource
Delegate:(id<WyhPageControlDelegate>)delegate
WithConfiguration:(void(^)(WyhPageControl *pageControl))configuration;


- (void)setCurrentPage:(NSInteger)currentPage;

- (CGSize)sizeForPageControl;

- (void)reloadData;



@end
Loading

0 comments on commit 15ea35c

Please sign in to comment.