创建cell导入xib

var cell = tableView.dequeueReusableCell(withIdentifier: String(describing: MyRankTableViewCell.self)) as? MyRankTableViewCell
        if cell == nil {
            cell = Bundle.main.loadNibNamed(String(describing: MyRankTableViewCell.self), owner: nil, options: nil)?.first as? MyRankTableViewCell
        }
        
        if let tempChildrenModel = myList?[indexPath.row] {
            cell?.childrenModel = tempChildrenModel
        }

你可能感兴趣的:(创建cell导入xib)