File tree Expand file tree Collapse file tree
Coding_iOS/Controllers/Topic Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,6 +214,18 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
214214 cell.mediaItemClickedBlock = ^(HtmlMediaItem *curItem){
215215 [weakSelf analyseLinkStr: curItem.href];
216216 };
217+
218+ cell.deleteClickedBlock = ^(Tweet *curTweet, NSInteger outTweetsIndex){
219+ if ([self .myMsgInputView isAndResignFirstResponder ]) {
220+ return ;
221+ }
222+ UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle: @" 删除此冒泡" buttonTitles: nil destructiveTitle: @" 确认删除" cancelTitle: @" 取消" andDidDismissBlock: ^(UIActionSheet *sheet, NSInteger index) {
223+ if (index == 0 ) {
224+ [weakSelf deleteTweet: curTweet];
225+ }
226+ }];
227+ [actionSheet showInView: self .view];
228+ };
217229
218230 [tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: 0 ];
219231
@@ -423,6 +435,21 @@ - (void)sendTweet{
423435 [self .parentViewController presentViewController: nav animated: YES completion: nil ];
424436}
425437
438+ #pragma mark Delete Tweet
439+ - (void )deleteTweet : (Tweet *)curTweet {
440+ ESWeakSelf;
441+ [[Coding_NetAPIManager sharedManager ] request_Tweet_Delete_WithObj: curTweet andBlock: ^(id data, NSError *error) {
442+ ESStrongSelf;
443+ if (data) {
444+ [_self.curTweets.list removeObject: curTweet];
445+ [_self.myTableView reloadData ];
446+ [_self.view configBlankPage: ([[Login curLoginUser ] isSameToUser: _self.curTweets.curUser]? EaseBlankPageTypeTweet: EaseBlankPageTypeTweetOther) hasData: (_self.curTweets.list.count > 0 ) hasError: NO reloadButtonBlock: ^(id sender) {
447+ ESStrongSelf;
448+ [_self sendRequest ];
449+ }];
450+ }
451+ }];
452+ }
426453@end
427454
428455
You can’t perform that action at this time.
0 commit comments