From 55b9b03967ab22db09ac9fc78ea6abcbadd350b4 Mon Sep 17 00:00:00 2001 From: jeongkite Date: Mon, 21 Nov 2022 17:00:18 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9E=95[ADD]=20UIViewController+=20swiftUI=20?= =?UTF-8?q?=EB=AF=B8=EB=A6=AC=EB=B3=B4=EA=B8=B0=20(X)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/Extensions/UIViewController+.swift | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Oliveyoung-iOS/Oliveyoung-iOS/Source/Common/Extensions/UIViewController+.swift diff --git a/Oliveyoung-iOS/Oliveyoung-iOS/Source/Common/Extensions/UIViewController+.swift b/Oliveyoung-iOS/Oliveyoung-iOS/Source/Common/Extensions/UIViewController+.swift new file mode 100644 index 0000000..4918455 --- /dev/null +++ b/Oliveyoung-iOS/Oliveyoung-iOS/Source/Common/Extensions/UIViewController+.swift @@ -0,0 +1,28 @@ +// +// UIViewController+.swift +// Oliveyoung-iOS +// +// Created by 양정연 on 2022/11/21. +// + +import Foundation +import SwiftUI + +#if DEBUG +extension UIViewController { + private struct Preview: UIViewControllerRepresentable { + let viewController: UIViewController + + func makeUIViewController(context: Context) -> UIViewController { + return viewController + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Context) { + } + } + + func toPreview() -> some View { + Preview(viewController: self) + } +} +#endif