I'm trying to make a very simple stickers iMessage application with user being proposed to in-app purchase when they click on some of the stickers.
I have a custom view controller that implements UIViewController
, UICollectionViewDelegate
, UICollectionViewDataSource
(source: https://github.com/jelenakrmar/customStickerApp).
I am now trying to override the default behaviour when the user taps or peels the sticker.
My first attempt was at the level of the collectionView
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
// open the in-app purchase window
}
but it doesn't work
Maybe I would need to extend MSStickerView
and do something in 'didTap
' and 'didLongPress
'.
Does anyone have some experience with overriding the behaviour of iMessage when selecting a sticker?