//
//  TTNewsListView.h
//  DFTTFramework
//
//  Created by 路鹏 on 2017/4/6.
//  Copyright © 2017年 路鹏. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "TTNewscfg.h"
#import "TTSortScrollTitleModel.h"

typedef void(^TTNewsListSuccessBlock)(NSString *success);
typedef void(^TTNewsListFailBlock)(NSString *fail);

@interface TTNewsListView : UIView

@property (nonatomic, assign) id delegate;
@property (nonatomic, assign) BOOL isAlloc;
@property (nonatomic, assign) CGFloat cellAllHeight;
@property (nonatomic, assign) BOOL isScroll;
@property (nonatomic, readonly) TTSortScrollTitleModel *sortModel;

- (void)setFrame:(CGRect)frame withNewsType:(TTNewscfg *)newscfg withSortModel:(TTSortScrollTitleModel *)sortModel withSuccess:(TTNewsListSuccessBlock)successBlock withFail:(TTNewsListFailBlock)failBlock;
- (void)headRefresh;
- (void)refresh;
- (CGFloat)getAllCellHeight;
- (void)cacheData;
- (void)scrollToTop:(BOOL)animate;
//移除的时候是否需要缓存数据
@property (nonatomic, assign) BOOL shoudCache;
@end



@protocol TTNewsListViewDelegate <NSObject>
@optional
- (void)TTNewsListView:(TTNewsListView *)newsListView CellClickWithNewsListModel:(id)newsListModel withNewsListCellType:(TTNewsListViewCellPushViewType)pushViewType;


- (void)TTNewsListViewBackToTop:(TTNewsListView *)newsListView;
- (void)TTNewsListiViewDidScroll:(UIScrollView *)scrollview;
@end
