 //
 
 import UIKit
-
-class CommentViewController: UITableViewController, UIViewControllerPreviewingDelegate,
-		BodyLabelDelegate {
+import Alamofire
+import AlamofireImage
+
+class CommentViewController: UITableViewController, BodyLabelDelegate {
 
     var submission: Submission! {
         didSet {

        comment.replies = nil
        tableView.insertRowsAtIndexPaths(indexPaths, withRowAnimation: .Automatic)
    }

    // MARK: - ViewControllerPreviewingDelegate

    func previewingContext(previewingContext: UIViewControllerPreviewing,
                           viewControllerForLocation location: CGPoint) -> UIViewController? {
//        guard let indexPath = tableView.indexPathForRowAtPoint(location) else {
//            return nil
//        }
//        let viewController = UIViewController()
//        let rawRect = tableView.rectForRowAtIndexPath(indexPath)
//        let rect = CGRectOffset(rawRect, -tableView.contentOffset.x, -tableView.contentOffset.y)
//
//        let cell = tableView.cellForRowAtIndexPath(indexPath)
//        viewController.preferredContentSize = CGSize.zero

        return nil
    }

    func previewingContext(previewingContext: UIViewControllerPreviewing,
                           commitViewController viewControllerToCommit: UIViewController) {
        showViewController(viewControllerToCommit, sender: self)
    }
    
    // MARK: BodyLabelDelegate
    func bodyLabel(link: Link) {
//        UIApplication.sharedApplication().openURL(NSURL(string: link.url)!)
        switch link.linkType {
        case .Normal:
            break

        tableView.estimatedRowHeight = 140
        tableView.separatorStyle = .None

        
        tableView.registerClass(SubmissionCellView.self,
                                forCellReuseIdentifier: "SubmissionCellView")
        tableView.registerClass(SubmissionImageCellView.self,
                                forCellReuseIdentifier: "SubmissionImageCellView")
        tableView.registerClass(TextCommentCellView.self,
                                forCellReuseIdentifier: "TextCommentCellView")
        tableView.registerClass(MoreCommentCellView.self,
