preselect collectionview
https://stackoverflow.com/questions/45610785/how-to-preselect-and-highlight-a-cell-from-a-uicollectionview
https://hackernoon.com/uicollectionviewcell-selection-made-easy-41dae148379d
if collectionview allow multiple selection remeber add this, cell item could be Deselect
save indexpath userdefault
https://stackoverflow.com/questions/34804294/how-to-save-nsindexpath-locally
https://stackoverflow.com/questions/37001643/how-to-add-nsindexpath-to-nsuserdefaults-in-swift
navigation presneted viewcontroller dismiss
https://stackoverflow.com/questions/31205002/why-is-it-bad-practice-to-have-a-viewcontroller-dismiss-itself
indexpath comparison
https://stackoverflow.com/questions/45610785/how-to-preselect-and-highlight-a-cell-from-a-uicollectionview
https://hackernoon.com/uicollectionviewcell-selection-made-easy-41dae148379d
if collectionview allow multiple selection remeber add this, cell item could be Deselect
collectionView.selectItem(at: indexPath, animated: true, scrollPosition: .top)
https://stackoverflow.com/questions/15330844/uicollectionview-select-and-deselect-issue
https://stackoverflow.com/questions/15330844/uicollectionview-select-and-deselect-issue
save indexpath userdefault
https://stackoverflow.com/questions/34804294/how-to-save-nsindexpath-locally
https://stackoverflow.com/questions/37001643/how-to-add-nsindexpath-to-nsuserdefaults-in-swift
navigation presneted viewcontroller dismiss
https://stackoverflow.com/questions/31205002/why-is-it-bad-practice-to-have-a-viewcontroller-dismiss-itself
indexpath comparison
if selectIndexPath.contains(indexPath) {
cell.isSelected = true
//collectionView.allowsMultipleSelection = true 後一定要加這行才可以DeSelect
collectionView.selectItem(at: indexPath, animated: true, scrollPosition: .top)
} else {
cell.isSelected = false
}
//cell.backgroundColor = indexPath.row % 2 == 0 ? .yellow : .blue
return cell
collectionview item spacing margin
https://stackoverflow.com/questions/13970950/uicollectionview-spacing-margins
alert controller
https://medium.com/@jacobhuang/swift-%E5%BB%BA%E7%AB%8B%E8%AD%A6%E5%91%8A%E8%A6%96%E7%AA%97-uialertcontroller-uialertaction-18c80a001649
button tapped to specific item
https://stackoverflow.com/questions/40786699/how-to-scroll-to-a-particluar-index-in-collection-view-in-swift
https://stackoverflow.com/questions/13970950/uicollectionview-spacing-margins
alert controller
https://medium.com/@jacobhuang/swift-%E5%BB%BA%E7%AB%8B%E8%AD%A6%E5%91%8A%E8%A6%96%E7%AA%97-uialertcontroller-uialertaction-18c80a001649
button tapped to specific item
https://stackoverflow.com/questions/40786699/how-to-scroll-to-a-particluar-index-in-collection-view-in-swift
留言
張貼留言