CheckmarkCollectionViewCell

master

UICollectionViewCell with checkbox when it isSelected and empty circle when not - like Photos.app "Select" mode.
yonat/CheckmarkCollectionViewCell

CheckmarkCollectionViewCell

Swift Version Build Status License CocoaPods Compatible
Platform PRs Welcome

UICollectionViewCell with checkbox when it isSelected and empty circle when not - like Photos.app "Select" mode.

Usage

class MyCell: CheckmarkCollectionViewCell {
    // get checkmark for free
}

Changing Appearance

The properties below can be set in Interface Builder, in code, or through a UIAppearance proxy (e.g., CheckmarkCollectionViewCell.appearance().deselectedImage = nil).

Shape:

cell.selectedImage = UIImage(named: "x")
cell.deselectedImage = UIImage(named: "o")

Color:

cell.tintColor = .red

Size:

cell.checkmarkSize = 42.0

Layout:

cell.checkmarkMargin = 17.0
cell.checkmarkLocation = [NSLayoutConstraint.Attribute.top, NSLayoutConstraint.Attribute.left]

Installation

CocoaPods:

pod 'CheckmarkCollectionViewCell'

Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/yonat/CheckmarkCollectionViewCell", from: "1.0.9")
]

Meta

@yonatsharon

https://github.com/yonat/CheckmarkCollectionViewCell

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

Last updated: Sun Nov 03 2024 00:13:28 GMT-0900 (Hawaii-Aleutian Daylight Time)