I have a SwiftUI simple application that presents UIViewControllerRepresentable
that holds a UIScrollView
.
When app goes to background and returns back, the layout of the scroll view changes.
struct FeedCategoryView: View {
var viewModel: LandingFeedCategoryViewModel
var body: some View {
VStack(spacing: 0) {
RepresentableViewController()
.frame(height: 287.8, alignment: .center)
.foregroundColor(.gray)
}
}
}
struct RepresentableViewController: UIViewControllerRepresentable {
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
}
func makeUIViewController(
context: UIViewControllerRepresentableContext<FeedVC>
) -> UIViewController {
return MyViewController()
}
}