2

I'm trying to use a Hosting Controller to include a SwiftUI View in an existing Storyboard Tab Bar Controller. I already connected a Hosting View Controller to the Tab Bar Controller on Storyboard using the Relationship Segue. Below is what I tried from reading other posts, but all I get is a black screen. Any help would be appreciated. Thank you.

enter image description here

import UIKit
import SwiftUI

class SingleSearchHost: UIHostingController<SingleSearch>{
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder, rootView: SingleSearch())
    }
}
Ryan Kanno
  • 105
  • 8

1 Answers1

1

The answer to my problem was to assign the class to the Host Controller in the Storyboard identity inspector. Thank you @Adam for answering this question!

Ryan Kanno
  • 105
  • 8