func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if sections[section].items.count == 0{
return CGFloat.leastNormalMagnitude
}
return tableView.sectionHeaderHeight
}
我只希望在 iOS 11 上显示此代码。如果用户使用的是 iOS 10,我不想以任何方式实现此委托(delegate)。
最佳答案
if #available(iOS 11.0, *) {
// set delegate here
} else {
// do nothing
}
关于ios - 如果它与 iOS 11 匹配,我如何告诉 xcode 包含特定的代码块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46677378/