YH_BarrageViewController.h 1.16 KB
//
//  YH_Barrage.h
//  YHBarrage
//
//  Created by Arthur on 16/6/6.
//  Copyright © 2016年 YOHO!. All rights reserved.
//

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

typedef NS_ENUM(NSUInteger, YHBarrageType) {
    YHBarrageTypeSend,     // 可发送评论
    YHBarrageTypeReadonly, // 只读
};

@class YH_BarrageViewController;
@protocol YH_BarrageViewControllerDelegate <NSObject>

@optional
- (void)yhBarrageViewController:(YH_BarrageViewController *)barrageVC didInsertItem:(NSDictionary *)itemDic;

@end


@interface YH_BarrageViewController : UIViewController

@property (weak, nonatomic) id<YH_BarrageViewControllerDelegate>delegate;
@property (strong, nonatomic) HPGrowingTextView *inputTextField;
@property (copy, nonatomic) void (^sendMsgBlock) (NSString *msg);
@property (copy, nonatomic) void (^loginToTCPServerBlock) (void);
@property (copy, nonatomic) void (^keyBoardShowBlock) (BOOL isShow, NSInteger height);

/**
 *  初始化弹幕
 *
 *  @param barrageType 弹幕类型
 *
 *  @return 实例化弹幕view
 */
- (instancetype)initWithType:(YHBarrageType)barrageType;


- (void)show;

- (void)insertItem:(NSDictionary *)itemdic;

- (void)reset;

@end