swift 中还是有interface文件的,只是没有显示出来,我们一般只能看到.m,文件,下面就告诉大家一个快捷键找到swift中的.h文件
control+commend+下键,
如图:下面是AppDelegate的.h文件

刷新tableView指定行
self.tableView.reloadRows(at: [IndexPath(row: indexPath.row - 1 , section : 0)], with: UITableViewRowAnimation.none);
// cell?.textLabel?.text = String(format: "第%d行 ", indexPath.row);
// cell.textLabel?.text = String(dataArr[indexPath.row] as! String)
// cell.detailTextLabel?.text = "test\(indexPath.row)
根据一个数组中的string 对另一个数组进行排序(这个数组放的是模型,模型中有上一个数组的string)
// sort and hidden
var titleKeyArr = Array<String>();
let titleKeyDic = NSMutableDictionary();
for item in self.tempModelPropertiesInfo {
titleKeyArr.append(item.titleKey!);
titleKeyDic.setValue(item, forKey: item.titleKey!)
}
let models = UserManager.sharedInstance.filterOrder;
for model in models! {
let modelString = Macros.Lstr(model.titleKey)
if !model.isHidden{
self.modelPropertiesInfo.append(titleKeyDic.value(forKey: modelString) as! FilterPropertyVM);
}
}
网友评论