![](/img/trans.png)
[英]Swift UICollectionViewCell didSelectItemAt not printing label name on cell
[英]Swift 3: CollectionView didSelectItemAt get selected cell label
我已經為此苦苦掙扎了一段時間,在其他地方找不到答案。 基本上,我需要在所選集合視圖單元格內編輯視圖。 例如,一旦單擊一個單元格,該單元格內的標簽文本就會更改。
如果我理解正確,則需要獲取所選的收藏夾視圖單元格:-
if let cell = collectionView.cellForItemAtIndexPath(indexPath) {
cell.textlabel.text = "yourtext"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.