【发布时间】:2017-11-26 11:51:06
【问题描述】:
如何控制在TableViewCell标签显示前,我的CollectionViewCell标签显示? 我的 CollectionViewCell 在 TableViewCell 中。
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as! CollectionViewCell
let list = sections[(indexPath as NSIndexPath).row]
DispatchQueue.main.async {
cell.categoryTitle.text = list.package_name
cell.mainAssociatedURL.text = list.package_url
cell.collectionView.tag = indexPath.row
cell.collectionView.reloadData()
}
return cell
}
}
我的 CollectionViewCell 在这里,
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let list = sections[indexPath.row].packageTable[indexPath.row]
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "videoCell", for: indexPath) as! CollecitonViewCell
AsyncImageLoader.sharedLoader.imageForUrl(urlString: list.poster_url) { (image, url) -> () in
DispatchQueue.main.async(){
cell.movieTitle.text = list.name
if(url == StringResource().posterURL){
cell.imageView.image = UIImage(named: "mmcast_cover")
}else{
cell.imageView.image = image
}
}
}
return cell
}
我想先显示 TableViewCell 标签显示,然后再显示 CollectionViewCell 标签和图像。
【问题讨论】:
-
不清楚,可以的话请多解释
-
@UsamaSadiq 我编辑了,希望你能理解。
标签: ios xcode swift3 uicollectionviewcell tableviewcell