Fix compose attachment gallery dismiss animation on iPad
This commit is contained in:
parent
25e4e35b1f
commit
da4787946d
@ -64,7 +64,12 @@ struct AttachmentsGalleryDataSource: GalleryDataSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func galleryContentTransitionSourceView(forItemAt index: Int) -> UIView? {
|
func galleryContentTransitionSourceView(forItemAt index: Int) -> UIView? {
|
||||||
collectionView.cellForItem(at: IndexPath(item: index, section: 0))
|
if let cell = collectionView.cellForItem(at: IndexPath(item: index, section: 0)) as? HostingCollectionViewCell {
|
||||||
|
// Use the hostView, because otherwise, the animation's changes to the source view opacity get clobbered by SwiftUI
|
||||||
|
cell.hostView
|
||||||
|
} else {
|
||||||
|
nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func fetchImageAndGIFData(assetID id: String) async -> (UIImage, Data?)? {
|
private func fetchImageAndGIFData(assetID id: String) async -> (UIImage, Data?)? {
|
||||||
|
@ -363,7 +363,7 @@ private final class IntrinsicContentSizeCollectionView: UICollectionView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if os(visionOS)
|
#if os(visionOS)
|
||||||
private class HostingCollectionViewCell: UICollectionViewCell {
|
final class HostingCollectionViewCell: UICollectionViewCell {
|
||||||
private(set) var hostView: UIView?
|
private(set) var hostView: UIView?
|
||||||
|
|
||||||
func setView<V: View>(_ view: V) {
|
func setView<V: View>(_ view: V) {
|
||||||
@ -382,7 +382,7 @@ private class HostingCollectionViewCell: UICollectionViewCell {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@available(iOS, obsoleted: 16.0)
|
@available(iOS, obsoleted: 16.0)
|
||||||
private class HostingCollectionViewCell: UICollectionViewCell {
|
final class HostingCollectionViewCell: UICollectionViewCell {
|
||||||
weak var containingViewController: UIViewController?
|
weak var containingViewController: UIViewController?
|
||||||
|
|
||||||
@available(iOS, obsoleted: 16.0)
|
@available(iOS, obsoleted: 16.0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user