快捷发言增加cd时间
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
///Tool
|
///Tool
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
#import "XPConstant.h"
|
#import "XPConstant.h"
|
||||||
|
#import "XCHUDTool.h"
|
||||||
///Model
|
///Model
|
||||||
#import "XPMessageRemoteExtModel.h"
|
#import "XPMessageRemoteExtModel.h"
|
||||||
#import "UserInfoModel.h"
|
#import "UserInfoModel.h"
|
||||||
@@ -26,6 +27,8 @@
|
|||||||
@property (nonatomic,strong) UIButton *closeButton;
|
@property (nonatomic,strong) UIButton *closeButton;
|
||||||
///代理
|
///代理
|
||||||
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
|
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
|
||||||
|
///最后发送消息的时间
|
||||||
|
@property (nonatomic, assign) long long lastSendTime;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -81,6 +84,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
- (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];
|
NSString *str = self.titleArray[indexPath.row];
|
||||||
[self sendText:str];
|
[self sendText:str];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user