Skip to content

Commit

Permalink
More fix to Archive
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed Aug 12, 2024
1 parent 57c2133 commit caac133
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#if !os(visionOS) && !DEBUG
import DesignSystem
import GiphyUISDK
@preconcurrency import GiphyUISDK
import SwiftUI
import UIKit


@MainActor
struct GifPickerView: UIViewControllerRepresentable {
@Environment(Theme.self) private var theme

Expand Down Expand Up @@ -33,20 +34,25 @@
GifPickerView.Coordinator(parent: self)
}

@MainActor
class Coordinator: NSObject, GiphyDelegate {
var parent: GifPickerView

init(parent: GifPickerView) {
self.parent = parent
}

@MainActor func didDismiss(controller _: GiphyViewController?) {
parent.onShouldDismissGifPicker()
nonisolated func didDismiss(controller _: GiphyViewController?) {
Task { @MainActor in
parent.onShouldDismissGifPicker()
}
}

@MainActor func didSelectMedia(giphyViewController _: GiphyViewController, media: GPHMedia) {
let url = media.url(rendition: .fixedWidth, fileType: .gif)
parent.completion(url ?? "")
nonisolated func didSelectMedia(giphyViewController _: GiphyViewController, media: GPHMedia) {
Task { @MainActor in
let url = media.url(rendition: .fixedWidth, fileType: .gif)
parent.completion(url ?? "")
}
}
}
}
Expand Down

0 comments on commit caac133

Please sign in to comment.