Reputation: 5213
I have a SwiftUI view called a paywall view.
I create and present it from UIKit view controller like this:
let paywallView = PaywallView()
let hostingController = UIHostingController(rootView: paywallView)
hostingController.modalPresentationStyle = .fullScreen
self.present(hostingController, animated: true)
Everything works fine and as expected, however, during the presentation transition / animation, these horizontal thin white lines appear and they go away once the animation is complete.
Side note: There is no navigation bar, navigation view or navigation stack in the SwiftUI view.
Any idea why this happens and how to solve this ?
Upvotes: 3
Views: 163
Reputation: 3000
Set the backgroundColor
of the hosting controller's view
as follows:
let hostingController = UIHostingController(rootView: rootView)
hostingController.view.backgroundColor = .clear
Upvotes: 0