From 89b7df25eaea32ca4d5397465be4eb813f4ce091 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sun, 21 Jan 2024 12:09:47 +0100 Subject: [PATCH 1/5] Make caption changable (#1138) --- .../Scene/Compose/ComposeViewController.swift | 3 ++- .../AttachmentViewModel+Upload.swift | 9 +++------ .../Attachment/AttachmentViewModel.swift | 19 +++++++++++++++---- .../ComposeContentViewController.swift | 9 ++++++--- .../ComposeContentViewModel.swift | 8 +++++--- .../Publisher/MastodonStatusPublisher.swift | 7 ++----- .../Scene/ShareViewController.swift | 6 ++++-- 7 files changed, 37 insertions(+), 24 deletions(-) diff --git a/Mastodon/Scene/Compose/ComposeViewController.swift b/Mastodon/Scene/Compose/ComposeViewController.swift index 71c797a9c..864af7512 100644 --- a/Mastodon/Scene/Compose/ComposeViewController.swift +++ b/Mastodon/Scene/Compose/ComposeViewController.swift @@ -284,7 +284,8 @@ extension ComposeViewController { authContext: viewModel.authContext, input: .image(image), sizeLimit: composeContentViewModel.sizeLimit, - delegate: composeContentViewModel + delegate: composeContentViewModel, + caption: nil ) } composeContentViewModel.attachmentViewModels += attachmentViewModels diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel+Upload.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel+Upload.swift index 58259d28c..943fb9cfe 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel+Upload.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel+Upload.swift @@ -120,15 +120,12 @@ extension AttachmentViewModel { } let attachment = output.asAttachment - + let query = Mastodon.API.Media.UploadMediaQuery( file: attachment, thumbnail: nil, - description: { - let caption = caption.trimmingCharacters(in: .whitespacesAndNewlines) - return caption.isEmpty ? nil : caption - }(), - focus: nil // TODO: + description: caption.trimmingCharacters(in: .whitespacesAndNewlines), + focus: nil ) // upload + N * check upload diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel.swift index 714db2a03..0a70ede81 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel.swift @@ -45,8 +45,10 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable public let authContext: AuthContext public let input: Input public let sizeLimit: SizeLimit + let originalCaption: String? @Published var caption = "" @Published public private(set) var isCaptionEditable = true + let isEditing: Bool // output @Published public private(set) var output: Output? @@ -75,15 +77,21 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable authContext: AuthContext, input: Input, sizeLimit: SizeLimit, - delegate: AttachmentViewModelDelegate + delegate: AttachmentViewModelDelegate, + isEditing: Bool = false, + caption: String? ) { self.api = api self.authContext = authContext self.input = input self.sizeLimit = sizeLimit self.delegate = delegate + self.isEditing = isEditing + + self.originalCaption = caption + self.caption = caption ?? "" + super.init() - // end init Timer.publish(every: 1.0 / 60.0, on: .main, in: .common) // 60 FPS .autoconnect() @@ -134,7 +142,9 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable switch input { case .mastodonAssetUrl: - self.isCaptionEditable = false + if self.isEditing == false { + self.isCaptionEditable = false + } self.uploadState = .finish self.output = output self.uploadResult = .exists @@ -258,7 +268,7 @@ extension AttachmentViewModel { public enum Input: Hashable { case image(UIImage) case url(URL) - case mastodonAssetUrl(URL, String) + case mastodonAssetUrl(url: URL, attachmentId: String) case pickerResult(PHPickerResult) case itemProvider(NSItemProvider) } @@ -321,4 +331,5 @@ extension AttachmentViewModel { func update(uploadResult: UploadResult) { self.uploadResult = uploadResult } + } diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift index 864160e06..063b6f20c 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift @@ -473,7 +473,8 @@ extension ComposeContentViewController: PHPickerViewControllerDelegate { authContext: viewModel.authContext, input: .pickerResult(result), sizeLimit: viewModel.sizeLimit, - delegate: viewModel + delegate: viewModel, + caption: nil ) } viewModel.attachmentViewModels += attachmentViewModels @@ -492,7 +493,8 @@ extension ComposeContentViewController: UIImagePickerControllerDelegate & UINavi authContext: viewModel.authContext, input: .image(image), sizeLimit: viewModel.sizeLimit, - delegate: viewModel + delegate: viewModel, + caption: nil ) viewModel.attachmentViewModels += [attachmentViewModel] } @@ -512,7 +514,8 @@ extension ComposeContentViewController: UIDocumentPickerDelegate { authContext: viewModel.authContext, input: .url(url), sizeLimit: viewModel.sizeLimit, - delegate: viewModel + delegate: viewModel, + caption: nil ) viewModel.attachmentViewModels += [attachmentViewModel] } diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift index bc1f14053..cdd0e88a4 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewModel.swift @@ -265,14 +265,16 @@ public final class ComposeContentViewModel: NSObject, ObservableObject { self.isVisibilityButtonEnabled = false self.attachmentViewModels = status.entity.mastodonAttachments.compactMap { guard let assetURL = $0.assetURL, let url = URL(string: assetURL) else { return nil } + let attachmentViewModel = AttachmentViewModel( api: context.apiService, authContext: authContext, - input: .mastodonAssetUrl(url, $0.id), + input: .mastodonAssetUrl(url: url, attachmentId: $0.id), sizeLimit: sizeLimit, - delegate: self + delegate: self, + isEditing: true, + caption: $0.altDescription ) - attachmentViewModel.caption = $0.altDescription ?? "" return attachmentViewModel } } diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusPublisher.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusPublisher.swift index 9db9faed9..42826976f 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusPublisher.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusPublisher.swift @@ -124,17 +124,14 @@ extension MastodonStatusPublisher: StatusPublisher { break case let .uploadedMastodonAttachment(attachment): attachmentIDs.append(attachment.id) - - let caption = attachmentViewModel.caption - guard !caption.isEmpty else { continue } - + _ = try await api.updateMedia( domain: authContext.mastodonAuthenticationBox.domain, attachmentID: attachment.id, query: .init( file: nil, thumbnail: nil, - description: caption, + description: attachmentViewModel.caption, focus: nil ), mastodonAuthenticationBox: authContext.mastodonAuthenticationBox diff --git a/ShareActionExtension/Scene/ShareViewController.swift b/ShareActionExtension/Scene/ShareViewController.swift index 4418c52bc..ad1f1f3e5 100644 --- a/ShareActionExtension/Scene/ShareViewController.swift +++ b/ShareActionExtension/Scene/ShareViewController.swift @@ -260,7 +260,8 @@ extension ShareViewController { authContext: authContext, input: .itemProvider(movieProvider), sizeLimit: .init(image: nil, video: nil), - delegate: composeContentViewModel + delegate: composeContentViewModel, + caption: nil ) composeContentViewModel.attachmentViewModels.append(attachmentViewModel) } else if !imageProviders.isEmpty { @@ -270,7 +271,8 @@ extension ShareViewController { authContext: authContext, input: .itemProvider(provider), sizeLimit: .init(image: nil, video: nil), - delegate: composeContentViewModel + delegate: composeContentViewModel, + caption: nil ) } composeContentViewModel.attachmentViewModels.append(contentsOf: attachmentViewModels) From 80cd22a3561b7e843a0e466355f08e37c4f06599 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sun, 21 Jan 2024 12:10:17 +0100 Subject: [PATCH 2/5] Update media if caption was changed (#1138) Doesn't work yet as the `/api/v1/media/:id` returns 404?! wtf?! --- .../Publisher/MastodonStatusEditPublisher.swift | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusEditPublisher.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusEditPublisher.swift index 893fb1a28..6669118d4 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusEditPublisher.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusEditPublisher.swift @@ -115,8 +115,22 @@ extension MastodonEditStatusPublisher: StatusPublisher { guard case let AttachmentViewModel.Input.mastodonAssetUrl(_, attachmentId) = attachmentViewModel.input else { throw AppError.badRequest } + attachmentIDs.append(attachmentId) - break + let needsUpdate = (attachmentViewModel.caption != attachmentViewModel.originalCaption) + if needsUpdate { + _ = try await api.updateMedia( + domain: authContext.mastodonAuthenticationBox.domain, + attachmentID: attachmentId, + query: Mastodon.API.Media.UpdateMediaQuery( + file: nil, + thumbnail: nil, + description: attachmentViewModel.caption, + focus: nil + ), + mastodonAuthenticationBox: authContext.mastodonAuthenticationBox + ).singleOutput() + } case let .uploadedMastodonAttachment(attachment): attachmentIDs.append(attachment.id) From 08a932ddfcef87238a3e003e0fb52990b96983f2 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Tue, 23 Jan 2024 10:30:15 +0100 Subject: [PATCH 3/5] Use correct endpoint to add media-attributes for changes (#1138) Also: Use JSON instead of Multipart --- .../MastodonSDK/API/Mastodon+API+Media.swift | 2 +- .../Mastodon+API+Statuses+StatusHistory.swift | 76 +++++++++++-------- .../MastodonStatusEditPublisher.swift | 29 +++---- 3 files changed, 58 insertions(+), 49 deletions(-) diff --git a/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Media.swift b/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Media.swift index 861b48c15..0995edafb 100644 --- a/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Media.swift +++ b/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Media.swift @@ -179,7 +179,7 @@ extension Mastodon.API.Media { extension Mastodon.API.Media { static func updateMediaEndpointURL(domain: String, attachmentID: Mastodon.Entity.Attachment.ID) -> URL { - return Mastodon.API.endpointURL(domain: domain).appendingPathComponent("media").appendingPathComponent(attachmentID) + Mastodon.API.endpointURL(domain: domain).appendingPathComponent("media").appendingPathComponent(attachmentID) } /// Update attachment diff --git a/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Statuses+StatusHistory.swift b/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Statuses+StatusHistory.swift index 096233c32..5ea6fe4c2 100644 --- a/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Statuses+StatusHistory.swift +++ b/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Statuses+StatusHistory.swift @@ -106,12 +106,41 @@ extension Mastodon.API.Statuses { } extension Mastodon.API.Statuses { + + public struct MediaAttributes: Codable { + let id: String + let description: String? + //TODO: Add focus at some point + + public init(id: String, description: String?) { + self.id = id + self.description = description + } + } + + public struct Poll: Codable { + public let options: [String]? + public let expiresIn: Int? + public let multipleAnswers: Bool? + + public init(options: [String]?, expiresIn: Int?, multipleAnswers: Bool?) { + self.options = options + self.expiresIn = expiresIn + self.multipleAnswers = multipleAnswers + } + + enum CodingKeys: String, CodingKey { + case options + case expiresIn = "expires_in" + case multipleAnswers = "multiple_answers" + } + } + public struct EditStatusQuery: Codable, PutQuery { public let status: String? public let mediaIDs: [String]? - public let pollOptions: [String]? - public let pollExpiresIn: Int? - public let pollMultipleAnswers: Bool? + public let mediaAttributes: [MediaAttributes]? + public let poll: Poll? public let sensitive: Bool? public let spoilerText: String? public let visibility: Mastodon.Entity.Status.Visibility? @@ -120,9 +149,8 @@ extension Mastodon.API.Statuses { public init( status: String?, mediaIDs: [String]?, - pollOptions: [String]?, - pollExpiresIn: Int?, - pollMultipleAnswers: Bool?, + mediaAttributes: [MediaAttributes]? = nil, + poll: Poll?, sensitive: Bool?, spoilerText: String?, visibility: Mastodon.Entity.Status.Visibility?, @@ -130,37 +158,23 @@ extension Mastodon.API.Statuses { ) { self.status = status self.mediaIDs = mediaIDs - self.pollOptions = pollOptions - self.pollExpiresIn = pollExpiresIn - self.pollMultipleAnswers = pollMultipleAnswers + self.mediaAttributes = mediaAttributes + self.poll = poll self.sensitive = sensitive self.spoilerText = spoilerText self.visibility = visibility self.language = language } - var contentType: String? { - return Self.multipartContentType() - } - - var body: Data? { - var data = Data() - - status.flatMap { data.append(Data.multipart(key: "status", value: $0)) } - for mediaID in mediaIDs ?? [] { - data.append(Data.multipart(key: "media_ids[]", value: mediaID)) - } - for pollOption in pollOptions ?? [] { - data.append(Data.multipart(key: "poll[options][]", value: pollOption)) - } - pollExpiresIn.flatMap { data.append(Data.multipart(key: "poll[expires_in]", value: $0)) } - sensitive.flatMap { data.append(Data.multipart(key: "sensitive", value: $0)) } - spoilerText.flatMap { data.append(Data.multipart(key: "spoiler_text", value: $0)) } - visibility.flatMap { data.append(Data.multipart(key: "visibility", value: $0.rawValue)) } - language.flatMap { data.append(Data.multipart(key: "language", value: $0)) } - - data.append(Data.multipartEnd()) - return data + enum CodingKeys: String, CodingKey { + case status + case mediaIDs = "media_ids" + case mediaAttributes = "media_attributes" + case poll + case sensitive + case spoilerText = "spoiler_text" + case visibility + case language } } } diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusEditPublisher.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusEditPublisher.swift index 6669118d4..127598bb5 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusEditPublisher.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Publisher/MastodonStatusEditPublisher.swift @@ -117,20 +117,6 @@ extension MastodonEditStatusPublisher: StatusPublisher { } attachmentIDs.append(attachmentId) - let needsUpdate = (attachmentViewModel.caption != attachmentViewModel.originalCaption) - if needsUpdate { - _ = try await api.updateMedia( - domain: authContext.mastodonAuthenticationBox.domain, - attachmentID: attachmentId, - query: Mastodon.API.Media.UpdateMediaQuery( - file: nil, - thumbnail: nil, - description: attachmentViewModel.caption, - focus: nil - ), - mastodonAuthenticationBox: authContext.mastodonAuthenticationBox - ).singleOutput() - } case let .uploadedMastodonAttachment(attachment): attachmentIDs.append(attachment.id) @@ -171,12 +157,21 @@ extension MastodonEditStatusPublisher: StatusPublisher { return self.pollExpireConfigurationOption.seconds }() + let poll = Mastodon.API.Statuses.Poll(options: pollOptions, expiresIn: pollExpiresIn, multipleAnswers: self.pollMultipleConfigurationOption) + + let mediaAttributes: [Mastodon.API.Statuses.MediaAttributes] = attachmentViewModels.compactMap { + if case let .mastodonAssetUrl(url: _, attachmentId: attachmentId) = $0.input { + return Mastodon.API.Statuses.MediaAttributes(id: attachmentId, description: $0.caption) + } else { + return nil + } + } + let query = Mastodon.API.Statuses.EditStatusQuery( status: content, mediaIDs: attachmentIDs.isEmpty ? nil : attachmentIDs, - pollOptions: pollOptions, - pollExpiresIn: pollExpiresIn, - pollMultipleAnswers: pollMultipleConfigurationOption, + mediaAttributes: mediaAttributes, + poll: poll, sensitive: isMediaSensitive, spoilerText: isContentWarningComposing ? contentWarning : nil, visibility: visibility, From f9ae531b4806902ff089aed98711d6872975d6a4 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Tue, 23 Jan 2024 10:31:05 +0100 Subject: [PATCH 4/5] Don't download edit-history (#1138) It was needed in the past when `editHistory` also persisted the history in CoreData. But as we don't use CoreData anymore... --- .../Service/API/APIService+Status+History.swift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status+History.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status+History.swift index 46ec1b9d4..3ce5905ea 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status+History.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Status+History.swift @@ -50,13 +50,6 @@ extension APIService { domain: domain, authorization: authorization).singleOutput() - _ = try await Mastodon.API.Statuses.editHistory( - forStatusID: statusID, - session: session, - domain: domain, - authorization: authorization - ).singleOutput() - return response } } From 3e200a77036291f318bf4ad0434c03edda3d4da0 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Tue, 23 Jan 2024 10:40:40 +0100 Subject: [PATCH 5/5] Minor cleanup (#1138) --- Mastodon/Scene/Compose/ComposeViewController.swift | 3 +-- .../ComposeContent/Attachment/AttachmentViewModel.swift | 4 +--- .../ComposeContent/ComposeContentViewController.swift | 9 +++------ ShareActionExtension/Scene/ShareViewController.swift | 6 ++---- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Mastodon/Scene/Compose/ComposeViewController.swift b/Mastodon/Scene/Compose/ComposeViewController.swift index 864af7512..71c797a9c 100644 --- a/Mastodon/Scene/Compose/ComposeViewController.swift +++ b/Mastodon/Scene/Compose/ComposeViewController.swift @@ -284,8 +284,7 @@ extension ComposeViewController { authContext: viewModel.authContext, input: .image(image), sizeLimit: composeContentViewModel.sizeLimit, - delegate: composeContentViewModel, - caption: nil + delegate: composeContentViewModel ) } composeContentViewModel.attachmentViewModels += attachmentViewModels diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel.swift index 0a70ede81..cf802e0b7 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel.swift @@ -45,7 +45,6 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable public let authContext: AuthContext public let input: Input public let sizeLimit: SizeLimit - let originalCaption: String? @Published var caption = "" @Published public private(set) var isCaptionEditable = true let isEditing: Bool @@ -79,7 +78,7 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable sizeLimit: SizeLimit, delegate: AttachmentViewModelDelegate, isEditing: Bool = false, - caption: String? + caption: String? = nil ) { self.api = api self.authContext = authContext @@ -88,7 +87,6 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable self.delegate = delegate self.isEditing = isEditing - self.originalCaption = caption self.caption = caption ?? "" super.init() diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift index 063b6f20c..864160e06 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/ComposeContentViewController.swift @@ -473,8 +473,7 @@ extension ComposeContentViewController: PHPickerViewControllerDelegate { authContext: viewModel.authContext, input: .pickerResult(result), sizeLimit: viewModel.sizeLimit, - delegate: viewModel, - caption: nil + delegate: viewModel ) } viewModel.attachmentViewModels += attachmentViewModels @@ -493,8 +492,7 @@ extension ComposeContentViewController: UIImagePickerControllerDelegate & UINavi authContext: viewModel.authContext, input: .image(image), sizeLimit: viewModel.sizeLimit, - delegate: viewModel, - caption: nil + delegate: viewModel ) viewModel.attachmentViewModels += [attachmentViewModel] } @@ -514,8 +512,7 @@ extension ComposeContentViewController: UIDocumentPickerDelegate { authContext: viewModel.authContext, input: .url(url), sizeLimit: viewModel.sizeLimit, - delegate: viewModel, - caption: nil + delegate: viewModel ) viewModel.attachmentViewModels += [attachmentViewModel] } diff --git a/ShareActionExtension/Scene/ShareViewController.swift b/ShareActionExtension/Scene/ShareViewController.swift index ad1f1f3e5..4418c52bc 100644 --- a/ShareActionExtension/Scene/ShareViewController.swift +++ b/ShareActionExtension/Scene/ShareViewController.swift @@ -260,8 +260,7 @@ extension ShareViewController { authContext: authContext, input: .itemProvider(movieProvider), sizeLimit: .init(image: nil, video: nil), - delegate: composeContentViewModel, - caption: nil + delegate: composeContentViewModel ) composeContentViewModel.attachmentViewModels.append(attachmentViewModel) } else if !imageProviders.isEmpty { @@ -271,8 +270,7 @@ extension ShareViewController { authContext: authContext, input: .itemProvider(provider), sizeLimit: .init(image: nil, video: nil), - delegate: composeContentViewModel, - caption: nil + delegate: composeContentViewModel ) } composeContentViewModel.attachmentViewModels.append(contentsOf: attachmentViewModels)