我正在尝试将数据表从SQL Server导出为func setConstraints() {
for i in 0...rows-1 {
for j in 0...cols-1 {
//First image
if (i == 0 && j == 0) {
floorImageView[i][j].anchor(top: self.view.safeAreaLayoutGuide.topAnchor, leading: self.view.safeAreaLayoutGuide.leadingAnchor, bottom: nil, trailing: nil, padding: .init(top: 180, left: 10, bottom: 0, right: 0), size: .init(width: 40, height: 40))
cellImageView[i][j].anchor(top: self.view.safeAreaLayoutGuide.topAnchor, leading: self.view.safeAreaLayoutGuide.leadingAnchor, bottom: nil, trailing: nil, padding: .init(top: 180, left: 10, bottom: 0, right: 0), size: .init(width: 40, height: 40))
}
//Middle rows
else if (i == 0 && j > 0) {
floorImageView[i][j].anchor(top: self.view.safeAreaLayoutGuide.topAnchor, leading: floorImageView[i][j-1].trailingAnchor, bottom: nil, trailing: nil, padding: .init(top: 180, left: 0, bottom: 0, right: 0), size: .init(width: 40, height: 40))
cellImageView[i][j].anchor(top: self.view.safeAreaLayoutGuide.topAnchor, leading: floorImageView[i][j-1].trailingAnchor, bottom: nil, trailing: nil, padding: .init(top: 180, left: 0, bottom: 0, right: 0), size: .init(width: 40, height: 40))
}
//First image of every row
else if (i > 0 && j == 0) {
floorImageView[i][j].anchor(top: floorImageView[i-1][j].bottomAnchor, leading: self.view.safeAreaLayoutGuide.leadingAnchor, bottom: nil, trailing: nil, padding: .init(top: 0, left: 10, bottom: 0, right: 0), size: .init(width: 40, height: 40))
cellImageView[i][j].anchor(top: floorImageView[i-1][j].bottomAnchor, leading: self.view.safeAreaLayoutGuide.leadingAnchor, bottom: nil, trailing: nil, padding: .init(top: 0, left: 10, bottom: 0, right: 0), size: .init(width: 40, height: 40))
}
//Middle js
else if (i > 0 && j > 0) {
floorImageView[i][j].anchor(top: floorImageView[i-1][j].bottomAnchor, leading: floorImageView[i][j-1].trailingAnchor, bottom: nil, trailing: nil, padding: .init(top: 0, left: 0, bottom: 0, right: 0), size: .init(width: 40, height: 40))
cellImageView[i][j].anchor(top: floorImageView[i-1][j].bottomAnchor, leading: floorImageView[i][j-1].trailingAnchor, bottom: nil, trailing: nil, padding: .init(top: 0, left: 0, bottom: 0, right: 0), size: .init(width: 40, height: 40))
}
//Last row
else if (i > 0 && j == cols-1) {
floorImageView[i][j].anchor(top: floorImageView[i-1][j].bottomAnchor, leading: floorImageView[i][j-1].trailingAnchor, bottom: nil, trailing: self.view.safeAreaLayoutGuide.trailingAnchor, padding: .init(top: 0, left: 0, bottom: 200, right: 10), size: .init(width: 40, height: 40))
cellImageView[i][j].anchor(top: floorImageView[i-1][j].bottomAnchor, leading: floorImageView[i][j-1].trailingAnchor, bottom: nil, trailing: self.view.safeAreaLayoutGuide.trailingAnchor, padding: .init(top: 0, left: 0, bottom: 200, right: 10), size: .init(width: 40, height: 40))
}
}
}
}
文件格式,但在此警告之后无法继续执行。我不知道如何解决这个问题,我需要在工作中更进一步。