快捷发言增加cd时间
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "XPConstant.h"
|
||||
#import "XCHUDTool.h"
|
||||
///Model
|
||||
#import "XPMessageRemoteExtModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
@@ -26,6 +27,8 @@
|
||||
@property (nonatomic,strong) UIButton *closeButton;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
|
||||
///最后发送消息的时间
|
||||
@property (nonatomic, assign) long long lastSendTime;
|
||||
|
||||
@end
|
||||
|
||||
@@ -81,6 +84,14 @@
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSDate *datenow = [NSDate date];//现在时间
|
||||
long time2 = (long)([datenow timeIntervalSince1970]*1000);
|
||||
long aTime = (time2 - self.lastSendTime) / 1000;
|
||||
if (aTime < 10) {
|
||||
[XCHUDTool showErrorWithMessage:@"你发送的太频繁啦,请稍后再试"];
|
||||
return;
|
||||
}
|
||||
self.lastSendTime = time2;
|
||||
NSString *str = self.titleArray[indexPath.row];
|
||||
[self sendText:str];
|
||||
}
|
||||
|
Reference in New Issue
Block a user