0
我怎樣才能得到和檢測項目的indexPath聚焦在這個代碼collectionView或?TVOS,檢測indexPath焦點更新
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
{}
我怎樣才能得到和檢測項目的indexPath聚焦在這個代碼collectionView或?TVOS,檢測indexPath焦點更新
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
{}
使用didUpdateFocusInContect - UICollectionViewDelegate
func collectionView(collectionView: UICollectionView, didUpdateFocusInContext context: UICollectionViewFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) {
// indexPath that is going to be focused
print(context.nextFocusedIndexPath)
// indexPath that is going to lose focus
print(context.previouslyFocusedIndexPath)
}