import SwiftUI
struct BlogPost {
let title: String
let author: String
let article: String
// Helper bridge to UIViewController to access enclosing UITabBarController
// and thus its UITabBar
struct TabBarAccessor: UIViewControllerRepresentable {
var callback: (UITabBar) -> Void
private let proxyController = ViewController()
func makeUIViewController(context: UIViewControllerRepresentableContext<TabBarAccessor>) ->
UIViewController {
// SwiftUi 드래그 팝 제스쳐 가능하도록 등록
extension UINavigationController: ObservableObject, UIGestureRecognizerDelegate {
override open func viewDidLoad() {
super.viewDidLoad()
// navigationBar.isHidden = true
interactivePopGestureRecognizer?.delegate = self
}
import UIKit
// 끝에 async 를 붙인다.
func performHeavyTask() async {
// Run some heavy tasks here...
print("하하하하하")
await Task.sleep(2_000_000_000)
print("기다림")
import UIKit
var greeting = "Hello, playground"
// 경우
enum Grade {
case kinderGarden
case elemetary
import Foundation
import UIKit
extension UIView {
class func fromNib(named: String? = nil) -> Self {
let name = named ?? "\(Self.self)"
guard let nib = Bundle.main.loadNibNamed(name, owner: nil, options: nil) else { fatalError("name Error") }