Skip to content

Commit

Permalink
fix report
Browse files Browse the repository at this point in the history
  • Loading branch information
touyu committed Mar 26, 2017
1 parent f802885 commit 55258de
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ extension AnnictRecordsViewController {
guard let cell = tableView.cellForRow(at: indexPath) as? AnnictRecordCell else { return }
if let record = cell.record, record.user.id == AnnictConsts.userID {
self.showActionSheet(recordID: record.id, indexPath: indexPath)
} else {
self.showReportActionSheet()
}
}

Expand Down Expand Up @@ -192,6 +194,15 @@ extension AnnictRecordsViewController {
}
}
}

fileprivate func showReportActionSheet() {
let actionSheet = UIAlertController(title: "", message: "選択してください", preferredStyle: .actionSheet)
let delete = UIAlertAction(title: "この記録を通報する", style: .destructive, handler: nil)
let cancel = UIAlertAction(title: "キャンセル", style: .cancel, handler: nil)
actionSheet.addAction(delete)
actionSheet.addAction(cancel)
present(actionSheet, animated: true, completion: nil)
}
}

extension AnnictRecordsViewController: IndicatorInfoProvider {
Expand Down

0 comments on commit 55258de

Please sign in to comment.