[ad_1]
Every time we attempt to use the beneath code snippet in our current UIKit challenge, we get the next error. After I transfer the identical code to a different Xcode challenge, it really works completely.
Error Msg: `Sort ‘MyUIKitViewControllerWrapper’ doesn’t conform to protocol ‘UIViewControllerRepresentable’
import Basis
import SwiftUI
struct MyUIKitViewControllerWrapper: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> MyUIKitViewController {
return MyUIKitViewController()
}
func updateUIViewController(_ uiViewController: MyUIKitViewController, context: Context) {
}
}
import Basis
import UIKit
// Create your UIKit view controller
ultimate class MyUIKitViewController: UIViewController {
override func viewDidLoad() {
tremendous.viewDidLoad()
// Arrange your UIKit view controller
let label = UILabel()
label.textual content = "Whats up from UIKit!"
label.textAlignment = .middle
label.body = CGRect(x: 0, y: 0, width: 200, peak: 50)
view.addSubview(label)
}
}
[ad_2]