 
                 let allFeeds = Array(unionFeedSet).sort({ $0.createdUnixTime > $1.createdUnixTime })
 
-                let newIndexPaths = allNewFeedSet.map({ allFeeds.indexOf($0) }).flatMap({ $0 }).map({ NSIndexPath(forRow: $0, inSection: 0) })
+                let newIndexPaths = allNewFeedSet.map({ allFeeds.indexOf($0) }).flatMap({ $0 }).map({ NSIndexPath(forRow: $0, inSection: Section.Feed.rawValue) })
 
                 dispatch_async(dispatch_get_main_queue()) {
 

        title = NSLocalizedString("Feeds", comment: "")

        feedsTableView.backgroundColor = UIColor.whiteColor()
        feedsTableView.registerNib(UINib(nibName: feedCellID, bundle: nil), forCellReuseIdentifier: feedCellID)
        feedsTableView.tableFooterView = UIView()
        feedsTableView.separatorColor = UIColor.yepCellSeparatorColor()

        updateFeeds()
    }


extension FeedsViewController: UITableViewDataSource, UITableViewDelegate {

    enum Section: Int {
        case SkillUsers
        case Feed
    }

    func numberOfSectionsInTableView(tableView: UITableView) -> Int {

        return 2
    }

    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

        switch section {
        case Section.SkillUsers.rawValue:
            return 1
        case Section.Feed.rawValue:
            return feeds.count
        default:
            return 0
        }
    }

    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

        switch indexPath.section {

        case Section.SkillUsers.rawValue:

            let cell = tableView.dequeueReusableCellWithIdentifier(feedSkillUsersCellID) as! FeedSkillUsersCell
            return cell

        case Section.Feed.rawValue:

            let cell = tableView.dequeueReusableCellWithIdentifier(feedCellID) as! FeedCell

            let feed = feeds[indexPath.item]

            cell.configureWithFeed(feed)

            cell.tapAvatarAction = { [weak self] in
                self?.performSegueWithIdentifier("showProfile", sender: indexPath)
            }

            cell.tapMediaAction = { [weak self] transitionView, imageURL in
                let info = [
                    "transitionView": transitionView,
                    "imageURL": imageURL,
                ]
                self?.performSegueWithIdentifier("showFeedMedia", sender: info)
            }

            // simulate select effects when tap on messageTextView or cell.mediaCollectionView's space part
            // 不能直接捕捉 indexPath，不然新插入后，之前捕捉的 indexPath 不能代表 cell 的新位置，模拟点击会错位到其它 cell
            cell.touchesBeganAction = { [weak self] cell in
                guard let indexPath = tableView.indexPathForCell(cell) else {
                    return
                }
                self?.tableView(tableView, willSelectRowAtIndexPath: indexPath)
                tableView.selectRowAtIndexPath(indexPath, animated: false, scrollPosition: .None)
            }
            cell.touchesEndedAction = { [weak self] cell in
                guard let indexPath = tableView.indexPathForCell(cell) else {
                    return
                }
                delay(0.03) {
                    self?.tableView(tableView, didSelectRowAtIndexPath: indexPath)
                }
            }
            cell.touchesCancelledAction = { cell in
                guard let indexPath = tableView.indexPathForCell(cell) else {
                    return
                }
                tableView.deselectRowAtIndexPath(indexPath, animated: true)
            }
            
            return cell

        default:
            return UITableViewCell()
        }
    }

    func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {

        switch indexPath.section {

        case Section.SkillUsers.rawValue:
            return 70

        case Section.Feed.rawValue:
            let feed = feeds[indexPath.item]
            return heightOfFeed(feed)

        default:
            return 0
        }
    }

    func tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -> NSIndexPath? {
