Fix compiling for Catalyst and visionOS

This commit is contained in:
Shadowfacts 2025-02-07 12:00:24 -05:00
parent fc458fc5f3
commit 2e3891c468
3 changed files with 7 additions and 1 deletions

View File

@ -210,11 +210,15 @@ private class WrappedCollectionViewController: UIViewController {
return section
}
let attachmentCell = UICollectionView.CellRegistration<HostingCollectionViewCell, DraftAttachment> { [unowned self] cell, indexPath, attachment in
#if !os(visionOS)
cell.containingViewController = self
#endif
cell.setView(AttachmentCollectionViewCellView(attachment: attachment))
}
let addButtonCell = UICollectionView.CellRegistration<HostingCollectionViewCell, Void> { [unowned self] cell, indexPath, item in
#if !os(visionOS)
cell.containingViewController = self
#endif
cell.setView(AddAttachmentButton(viewController: self))
}
let collectionView = IntrinsicContentSizeCollectionView(frame: .zero, collectionViewLayout: layout)

View File

@ -27,7 +27,7 @@ struct ComposeNavigationBarActions: ToolbarContent {
DraftsButton(isShowingDrafts: $isShowingDrafts)
}
ToolbarItem(placement: .confirmationAction) {
PostButton(draft: draft, isPosting: isPosting)
PostButton(draft: draft, isPosting: isPosting, postStatus: postStatus)
}
#else
ToolbarItem(placement: .confirmationAction) {

View File

@ -137,7 +137,9 @@ private struct ComposeViewBody: View {
ScrollView {
scrollContent
}
#if !os(visionOS)
.scrollDismissesKeyboardInteractivelyIfAvailable()
#endif
#if !os(visionOS) && !targetEnvironment(macCatalyst)
.modifier(ToolbarSafeAreaInsetModifier())
#endif