Skip to content

Commit

Permalink
support tap in SimpleViewProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzhao committed Aug 8, 2018
1 parent 7a0ab86 commit a17d8ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/Addon/SimpleViewProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ open class SimpleViewProvider: ItemProvider, CollectionReloadable {
didSet { setNeedsReload() }
}
public var animator: Animator? { didSet { setNeedsReload() } }
public var tapHandler: ((UIView) -> Void)?

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

public func update(view: UIView, at: Int) {}
public func didTap(view: UIView, at: Int) {}
public func didTap(view: UIView, at: Int) {
tapHandler?(view)
}

struct SimpleViewLayoutContext: LayoutContext {
let collectionSize: CGSize
Expand Down

0 comments on commit a17d8ea

Please sign in to comment.