の中に がありUICollectionView
、UIViewController
の内側と外側のジェスチャに応答するようにしUICollectionView
ます。デフォルトでは、UICollectionView
はそれ自体の内側のジェスチャにのみ応答しますview
が、その外側のスワイプに応答させるにはどうすればよいview
ですか?
ありがとう。
の中に がありUICollectionView
、UIViewController
の内側と外側のジェスチャに応答するようにしUICollectionView
ます。デフォルトでは、UICollectionView
はそれ自体の内側のジェスチャにのみ応答しますview
が、その外側のスワイプに応答させるにはどうすればよいview
ですか?
ありがとう。
ネイラーの答えの迅速なバージョン、これはビューコントローラーで行われたすべてのジェスチャーをコレクションビューに転送します
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
collectionView.touchesBegan(touches, withEvent: event)
}
override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
collectionView.touchesEnded(touches, withEvent: event)
}
override func touchesCancelled(touches: Set<UITouch>?, withEvent event: UIEvent?) {
collectionView.touchesCancelled(touches, withEvent: event)
}
override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
collectionView.touchesMoved(touches, withEvent: event)
}