当我在创建约束后立即尝试更新 snapkit 约束时,出现Updated constraint could not find existing matching constraint to update
错误。我正在使用的代码如下:
let directionList = UITableView()
directionList.delegate = self
directionList.dataSource = self
directionList.tag = DIRECTIONS_TABLE_TAG
self.view.addSubview(directionList)
directionList.snp.makeConstraints{ (make) -> Void in
make.width.equalToSuperview()
make.top.equalTo(self.view.snp.bottom)
make.left.equalToSuperview()
make.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-20)
}
directionList.snp.updateConstraints { (make) -> Void in
make.top.equalTo(self.topDarkBlue.snp.bottom)
}