Skip to content

Commit a17d8ea

Browse files
committed
support tap in SimpleViewProvider
1 parent 7a0ab86 commit a17d8ea

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Sources/Addon/SimpleViewProvider.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ open class SimpleViewProvider: ItemProvider, CollectionReloadable {
2626
didSet { setNeedsReload() }
2727
}
2828
public var animator: Animator? { didSet { setNeedsReload() } }
29+
public var tapHandler: ((UIView) -> Void)?
2930

3031
public init(identifier: String? = nil,
3132
views: [UIView] = [],
@@ -76,7 +77,9 @@ open class SimpleViewProvider: ItemProvider, CollectionReloadable {
7677
}
7778

7879
public func update(view: UIView, at: Int) {}
79-
public func didTap(view: UIView, at: Int) {}
80+
public func didTap(view: UIView, at: Int) {
81+
tapHandler?(view)
82+
}
8083

8184
struct SimpleViewLayoutContext: LayoutContext {
8285
let collectionSize: CGSize

0 commit comments

Comments
 (0)