Post

Replies

Boosts

Views

Activity

Reply to Detect when AVPictureInPictureController shows black screen
I found this requiresFlushToResumeDecoding will become true after iPhone lock for a while, before PiP turns black screen. Then as the doc says, flush the bufferLayer will resume it. So here is the solution for me: if bufferLayer.requiresFlushToResumeDecoding { bufferLayer.flush() } if bufferLayer.isReadyForMoreMediaData { bufferLayer.enqueue(sampleBuffer) }
Sep ’24
Reply to UICollectionView scrollToItem broken on iOS14
For anyone who encounter this issue and if you are using UICollectionViewCompositionalLayout. It seems you can't set both the collectionView's isPageEnabled = true and the UICollectionViewCompositionalLayout's orthogonalScrollingBehavior = .groupPaging. I keep only orthogonalScrollingBehavior = .groupPaging (or .paging any scenario you want), and set collectionView's isPageEnabled = false. Then the scroll to item issue will be gone.
1w