|
//
// ReportController.swift
// PaiAi
//
// Created by 郑剑飞 on 2016/10/16.
// Copyright © 2016年 FFIB. All rights reserved.
//
import UIKit
final class ReportController: UIViewController, UITableViewDataSource, UITableViewDelegate {
// MARK: Storyboard property
@IBOutlet weak var contentView: UIView!
@IBOutlet weak var reportTableView: UITableView!
let transitioning = FFTransitioning(alertStyle: .actionSheet)
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
transitioningDelegate = transitioning
}
// MARK: data property
lazy var dataArray: [String] = ["辱骂、歧视、诽谤、挑衅等不友善的内容", "色情、暴力、血腥等违反法律法规的内容", "广告", "其他"]
// MARK: view function
override func viewDidLoad() {
super.viewDidLoad()
// showBottomAnimated(animationView: contentView)
}
// MARK: Storyboard button function
@IBAction func cancelAction(_ sender: UIButton) {
removeControllerAndViewFromParent()
}
public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
removeControllerAndViewFromParent()
}
}
// MARK: UITableView delegate
extension ReportController {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataArray.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "reportCell", for: indexPath)
cell.textLabel?.text = dataArray[indexPath.row]
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// dismissBottomAnimated(animationView: contentView)
FFToastView.showToast(inView: (parent?.view)!, withText: "举报成功")
}
}
|