Thursday, September 22, 2022
HomeiOS Developmentios - Find out how to set the width and peak of...

ios – Find out how to set the width and peak of uiview “Youngster” and viewController “guardian”


I’ve this MiniViewController is UIViewControllerRepresentable in swiftUI view
what I’m attempting to do is ready the width, and the peak of uiview ” miniView is Youngster” and viewController “miniVC guardian” with out onerous coding the width and the peak quantity

  struct MiniViewController: UIViewControllerRepresentable {
        public typealias UIViewControllerType = UIViewController
        public func makeUIViewController(context: Context) -> UIViewController {
            let miniView = UIView()
            ## Heading ##//the right way to set the width, and the peak from SwiftUI view 
            miniView.body = CGRect(x: 0, y: 0, width: 390, peak: 70)
            miniView.backgroundColor = .crimson
            let miniVC = UIViewController()
            miniVC.view.addSubview(miniView)
            miniVC.view.backgroundColor = .yellow
            //the right way to set the width, and the peak from SwiftUI view 

            miniVC.view.body =  CGRect(x: 0, y: 0, width: 390, peak: 70)
            ...
        public func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
        }
    }

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments