     private var isPrivate: Bool
     private var dismissing = false
     private var currentRow = 0
+    private var verticalConstraints: [Constraint] = []
     
     lazy var tableView: UITableView = {
         let tableView = UITableView()

        }
    }
    
    init(profile: Profile, backForwardList: WKBackForwardList, isPrivate: Bool) {
        self.profile = profile
        self.isPrivate = isPrivate

        guard let bvc = self.bvc else {
            return
        }
        if bvc.shouldShowFooterForTraitCollection(newCollection) != snappedToBottom {
            tableView.snp_updateConstraints { make in
                if snappedToBottom {
                    make.bottom.equalTo(self.view).offset(0)
                } else {
                    make.top.equalTo(self.view).offset(0)
                }
                make.height.equalTo(0)
            }
            snappedToBottom = !snappedToBottom
        }
    }
    
    override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
        let correctHeight = {
            self.tableView.snp_updateConstraints { make in
                make.height.equalTo(min(CGFloat(BackForwardViewUX.RowHeight * self.listData.count), size.height / 2))
            }
        }
        coordinator.animateAlongsideTransition(nil) { _ in
            self.remakeVerticalConstraints()
            correctHeight()
        }
    }
    
    func remakeVerticalConstraints() {
        guard let bvc = self.bvc else {
            return
        }
        for constraint in self.verticalConstraints {
            constraint.deactivate()
        }
        self.verticalConstraints = []
        tableView.snp_makeConstraints { make in
            if snappedToBottom {
                verticalConstraints += [make.bottom.equalTo(self.view).offset(-bvc.footer.frame.height).constraint]
            } else {
                verticalConstraints += [make.top.equalTo(self.view).offset(bvc.header.frame.height + UIApplication.sharedApplication().statusBarFrame.size.height).constraint]
            }
        }
        shadow.snp_makeConstraints() { make in
            if snappedToBottom {
                verticalConstraints += [
                    make.bottom.equalTo(tableView.snp_top).constraint,
                    make.top.equalTo(self.view).constraint
                ]
                
            } else {
                verticalConstraints += [
                    make.top.equalTo(tableView.snp_bottom).constraint,
                    make.bottom.equalTo(self.view).constraint
                ]
            }
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(shadow)
        view.addSubview(tableView)
        self.snappedToBottom = self.bvc?.toolbar != nil 
        tableView.snp_makeConstraints { make in
            make.height.equalTo(0)
            make.left.right.equalTo(self.view)
        }
        shadow.snp_makeConstraints { make in
            make.left.right.equalTo(self.view)
        }
        remakeVerticalConstraints()
        view.layoutIfNeeded()
        scrollTableViewToIndex(currentRow)
        setupDismissTap()
