Skip to content

Commit

Permalink
➕[ADD] UIViewController+ swiftUI 미리보기 (X)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongkite committed Nov 21, 2022
1 parent d09ca35 commit 55b9b03
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 55b9b03

Please sign in to comment.