Skip to content

Instantly share code, notes, and snippets.

@iamidzic
Created March 11, 2021 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamidzic/642b9990597ec016db8487391db080f7 to your computer and use it in GitHub Desktop.
Save iamidzic/642b9990597ec016db8487391db080f7 to your computer and use it in GitHub Desktop.
HostingViewController example
import SwiftUI
class SettingsViewController: UIHostingController<SettingsView> {
override init(rootView: SettingsView) {
super.init(rootView: rootView)
tabBarItem = UITabBarItem(title: "Settings", image: UIImage(systemName: "gearshape"), selectedImage: UIImage(systemName: "gearshape.fill"))
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment