IOS - Swift - uicollectionView внутри UitableViewCell Не прокручивайте после первого шоуIOS

Программируем под IOS
Anonymous
IOS - Swift - uicollectionView внутри UitableViewCell Не прокручивайте после первого шоу

Сообщение Anonymous »

У меня есть этот класс: < /p>

Код: Выделить всё

class SectionCellRowCollection: UICollectionView, UICollectionViewDataSource, UICollectionViewDelegate {

required init?(coder aDecoder: NSCoder){
fatalError("init(coder:) has not been implemented")
}

override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout){
super.init(frame: frame, collectionViewLayout: layout)

self.initialize()
}

private func initialize(){
self.dataSource = self
self.delegate = self

self.delaysContentTouches = true
self.allowsSelection = false
self.canCancelContentTouches = true

self.backgroundView = nil
self.backgroundColor = .clear
}

override func touchesBegan(_ touches: Set, with event: UIEvent?){
print("TOUCH began...")

super.touchesBegan(touches, with: event)
self.next?.touchesBegan(touches, with: event) //send touch "down"
}

override func touchesEnded(_ touches: Set, with event: UIEvent?) {
super.touchesEnded(touches, with: event)
self.next?.touchesEnded(touches, with: event) //send touch "down"
}

func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
print("scrollViewWillBeginDragging")
}

func scrollViewDidScroll(_ scrollView: UIScrollView) {
print("scroll")
}

//init cells etc
}
Проблема заключается в том, что после первого показа в коллекции, когда я перехожу в левый/справа, Touchesbegan называется вместо Scrollviewdidscroll или scrollviewwillbegindragging . Когда я снова выпускаю Touch and Touch, Touchesbegan не вызывается, и ScrollViewDidsCroll работает.
Я не знаю, что искать, так как это сложно отладить.

Подробнее здесь: https://stackoverflow.com/questions/794 ... fter-first

Вернуться в «IOS»