From 0282828fe87221efd9401842c514c4902f339ff2 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 2 Feb 2025 11:04:01 -0800 Subject: [PATCH] Delete some unused code. --- .../UIKit/UIViewController+RSCore.swift | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/Modules/RSCore/Sources/RSCore/UIKit/UIViewController+RSCore.swift b/Modules/RSCore/Sources/RSCore/UIKit/UIViewController+RSCore.swift index d13ebf948..cf2000707 100644 --- a/Modules/RSCore/Sources/RSCore/UIKit/UIViewController+RSCore.swift +++ b/Modules/RSCore/Sources/RSCore/UIKit/UIViewController+RSCore.swift @@ -5,6 +5,7 @@ // Created by Maurice Parker on 4/15/19. // Copyright © 2019 Ranchero Software. All rights reserved. // + #if os(iOS) import UIKit import SwiftUI @@ -23,32 +24,4 @@ extension UIViewController { self.present(alertController, animated: true, completion: nil) } } - -// MARK: SwiftUI - -public struct ViewControllerHolder { - public weak var value: UIViewController? -} - -public struct ViewControllerKey: EnvironmentKey { - public static var defaultValue: ViewControllerHolder { return ViewControllerHolder(value: nil ) } -} - -extension EnvironmentValues { - public var viewController: UIViewController? { - get { return self[ViewControllerKey.self].value } - set { self[ViewControllerKey.self].value = newValue } - } -} - -extension UIViewController { - public func present(style: UIModalPresentationStyle = .automatic, @ViewBuilder builder: () -> Content) { - let controller = UIHostingController(rootView: AnyView(EmptyView())) - controller.modalPresentationStyle = style - controller.rootView = AnyView( - builder().environment(\.viewController, controller) - ) - self.present(controller, animated: true, completion: nil) - } -} #endif