设为首页 加入收藏

TOP

上拉下拉基类(一)
2017-10-11 15:24:52 】 浏览:10826
Tags:下拉

#import <UIKit/UIKit.h>

#import "SVPullToRefresh.h"

#import "YQZViewController.h"

 

@interface YQZPullViewController : YQZViewController

{

    IBOutlet UITableView *contentTableView;

    NSMutableArray *dataSource;

    IBOutlet UIView *emptyDataView;

    IBOutlet UIImageView* emptyImgView;

    IBOutlet UILabel *emptyDataLabel;

    int currentPage;

}

 

@property (nonatomic, strong) IBOutlet UITableView *contentTableView;

@property (nonatomic, strong) IBOutlet UIView *emptyDataView;

@property (nonatomic, strong) IBOutlet UIImageView* emptyImgView;

@property (nonatomic, strong) IBOutlet UILabel *emptyDataLabel;

@property (nonatomic, strong) UISegmentedControl *segmentControl;

//进行中新进展数字标签

@property (nonatomic, strong) UILabel *unFinishedLabel;

//已完成新进展数字标签

@property (nonatomic, strong) UILabel *finishedlabel;

//未读数字标签

@property (nonatomic, strong) UILabel *unReadlabel;

 

@property (nonatomic, strong) NSMutableArray *dataSource;

@property (nonatomic, assign) int currentPage;

@property (nonatomic, assign) int totalPages;

 

- (void)insertRowAtTop:(NSArray *)newDatas;

- (void)insertRowAtBottom:(NSArray *)newDatas;

- (void)upRefresh;

- (void)bottomRefresh;

- (void)addSegmentControl;

- (void)addSegmentControlWithArray:(NSArray *)segmentArray;

- (void)addUnReadControl;

- (void)setSegmentNumValue:(NSInteger)unfinishValue finishValue:(NSInteger)finishValue;

- (void)showToast:(NSString *)text;

- (void)resetUIConstraint;

@end

 

 

#import "YQZPullViewController.h"

#import "SDWebImageManager.h"

 

@interface YQZPullViewController ()<UITableViewDataSource, UITableViewDelegate>

@end

 

@implementation YQZPullViewController

 

@synthesize contentTableView;

@synthesize emptyDataView;

@synthesize emptyImgView;

@synthesize emptyDataLabel;

@synthesize dataSource;

@synthesize currentPage;

@synthesize totalPages;

 

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

        // Custom initialization

        self.dataSource = [NSMutableArray array];

        self.currentPage = 0;

    }

    return self;

}

 

- (void)viewDidLoad

{

    [super viewDidLoad];

    

    self.contentTableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain];

    self.contentTableView.delegate = self;

    self.contentTableView.dataSource = self;

    self.contentTableView.backgroundColor = kYQZLightGrayColor;

    [self.view addSubview:self.contentTableView];

    

    __weak YQZPullViewController *weakself = self;

 

    [self.contentTableView addPullToRefreshWithActionHandler:^{

        [weakself upRefresh];

    }];

    

    // setup infinite scrolling

    [self.contentTableView addInfiniteScrollingWithActionH

首页 上一页 1 2 3 4 5 6 下一页 尾页 1/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇微信小程序开发系列(二)小程序.. 下一篇移动端开发之APP消息推送

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目