I am writing an iOS card game. I display the player's cards in a collection view. The player can select one or more cards by tapping on them, and then press a deal button to deal the selected cards.
I want to allow the user to use multiple fingers to select multiple cards at once. For example, if the user wants to select 2 cards, he just needs to tap the two cards at the same time, with two fingers, and they will both be selected. It seems like that by default, UICollectionView
does not allow this. When I tap with 2 fingers, only one of the cards will be selected, even though the isMultipleTouchEnabled
property in UIView
is already set to true.
Note that I am not asking about how to allow a user to select multiple items in a collection view. I can and did already do that with allowsMultipleSelection = true
. What I am asking is how to allow the user to select 2 cells with 2 fingers (or n cells with n fingers).
I found this question, but that seems to be about how to show a border around a cell when it is selected.
I also looked into the documentation of UICollectionView
but I found no property that controls this.
UITapGestureRecogniser
? How can I figure out which cell is tapped given a set of coordinates? – Corner