If you add TabbedView to NavigationView in this example, please use Xcode 11 Beta 2.
- MainViewPreviews.swift Select all
// MainViewPreviews.swift
// FishTagCreator
//
// Created by javacom on 8 Jun 2019.
//
import SwiftUI
#if DEBUG
struct MainViewControllerPreviews : PreviewProvider, UIViewControllerRepresentable {
// MARK: PreviewProvider
static var previews: some View {
MainViewControllerPreviews()
}
// MARK: UIViewControllerRepresentable
typealias UIViewControllerType = MainViewController
func makeUIViewController(
context: Context
) -> MainViewController {
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let mainViewController: MainViewController = mainStoryboard.instantiateViewController(withIdentifier: "MainController") as! MainViewController
return mainViewController
}
func updateUIViewController(
_ uiViewController : MainViewController, context: Context) {
}
}
#endif
It is important to assign a storyboard ID say "MainController" to your MainViewController in Main.storyboard's identity inspector.
No comments:
Post a Comment