2016-10-04 54 views
0

我的集合視圖可重新訂購,因爲它的flowLayout對象使用LXReorderableCollectionViewFlowLayout,我不希望我的集合視圖的部分標題響應長按。但是我無法檢查它是否是下面的委託調用中的節標題或單元格。如何忽略UICollectionView上的節標題視圖上的長按?

func collectionView(collectionView: UICollectionView, canMoveItemAtIndexPath indexPath: NSIndexPath) -> Bool { 
} 

有什麼想法嗎?

回答

0

您可以將檢查,看看有什麼樣的小區用戶的是長按:

func collectionView(collectionView: UICollectionView, canMoveItemAtIndexPath indexPath: NSIndexPath) -> Bool { 

    if let cell = collectionView.cellForItemAtIndexPath(indexPath) as? SectionClassName { 
     return false 
    } 

}