mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-27 05:49:25 -04:00
Library cell selection actions
This commit is contained in:
parent
5d651c7a83
commit
4698d52195
@ -203,6 +203,14 @@ class LibraryBooksController: CoreDataCollectionBaseController, UICollectionView
|
||||
return header
|
||||
}
|
||||
|
||||
// MARK: - UICollectionView Delegate
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
collectionView.deselectItem(at: indexPath, animated: true)
|
||||
guard let cell = collectionView.cellForItem(at: indexPath) as? LibraryCollectionCell else {return}
|
||||
didTapMoreButton(cell: cell)
|
||||
}
|
||||
|
||||
// MARK: - UICollectionViewDelegateFlowLayout
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
||||
|
@ -86,7 +86,6 @@
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Wbk-Lp-yTb" firstAttribute="centerY" secondItem="Aea-Om-Uku" secondAttribute="centerY" id="3Lj-sz-46B"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="nTw-d7-YqD" secondAttribute="trailing" id="5JR-74-PhA"/>
|
||||
|
@ -187,6 +187,12 @@ class LibraryCollectionCell: UICollectionViewCell {
|
||||
@IBOutlet weak var descriptionLabel: UILabel!
|
||||
@IBOutlet weak var hasPicLabel: UILabel!
|
||||
@IBOutlet weak var moreButton: UIButton!
|
||||
|
||||
override var isSelected: Bool {
|
||||
didSet {
|
||||
backgroundColor = isSelected ? UIColor(colorLiteralRed: 200/255, green: 220/255, blue: 1, alpha: 1) : UIColor.clear
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user