LayoutKit
LayoutKit copied to clipboard
Using Custom UIControll callback event & flickery issue
I'm using layoutKit with UICollectionView. Using a custom UIControll object with SizeLayout in specific Cell causing weird behavior.
let reaction = SizeLayout<ReactionButton>(
height: 40,
viewReuseId: "reaction",
config: { reactionButton in
reactionButton.reactionSelector = ReactionSelector()
reactionButton.config = ReactionButtonConfig() {
$0.iconMarging = 8
$0.spacing = 6
$0.alignment = .centerLeft
}
reactionButton.reaction = content.reaction
if let selector = content.reactionSelector{
reactionButton.addTarget(content.target, action: selector, for: .valueChanged)
reactionButton.addTarget(content.target, action: selector, for: .touchUpInside)
}
})
.ValueChangeD and .TouchUpInside event gets called multiple times in different indexes for a Single Press event. And also there is a flickery issue exist while scrolling if I generate the cell layout with this custom UIControll.