Skip to content

Commit

Permalink
Update RefdsViewController.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelesantos committed Oct 7, 2024
1 parent c045fa7 commit 2e71e3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/RefdsShared/Application/RefdsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AppKit
import UIKit
#endif

public protocol RefdsViewControllerProtocol {
public protocol RefdsViewControllerProtocol: Sendable {
func present(_ viewController: RefdsViewController?) async
}

Expand All @@ -19,20 +19,20 @@ public class RefdsViewController: NSViewController, RefdsViewControllerProtocol

public extension NSViewController {
var refdsViewController: RefdsViewController? {
self as? RefdsViewController
get async { self as? RefdsViewController }
}
}
#else
public class RefdsViewController: UIViewController, RefdsViewControllerProtocol {
public func present(_ viewController: RefdsViewController?) {
public func present(_ viewController: RefdsViewController?) async {
guard let viewController = viewController else { return }
self.present(viewController, animated: true)
}
}

public extension UIViewController {
var refdsViewController: RefdsViewController? {
self as? RefdsViewController
get async { self as? RefdsViewController }
}
}
#endif

0 comments on commit 2e71e3c

Please sign in to comment.