Skip to content

Commit

Permalink
Update RefdsViewController.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelesantos committed Aug 22, 2024
1 parent 12a3f6e commit 50bb657
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/RefdsShared/Application/RefdsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import UIKit
#endif

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

#if os(macOS)
public class RefdsViewController: NSViewController, RefdsViewControllerProtocol {
public func present(_ viewController: RefdsViewController) {
public func present(_ viewController: RefdsViewController?) {
guard let viewController = viewController else { return }
self.presentAsModalWindow(viewController)
}
}
Expand All @@ -23,7 +24,8 @@ public extension NSViewController {
}
#else
public class RefdsViewController: UIViewController, RefdsViewControllerProtocol {
public func present(_ viewController: RefdsViewController) {
public func present(_ viewController: RefdsViewController?) {
guard let viewController = viewController else { return }
self.present(viewController, animated: true)
}
}
Expand Down

0 comments on commit 50bb657

Please sign in to comment.