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