I have the following code in my SwiftUI code:
@Binding var tabSelection: Int
init() {
UINavigationBar.appearance().barTintColor = .clear
UINavigationBar.appearance().backgroundColor = .clear; UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
UINavigationBar.appearance().shadowImage = UIImage()
}
But when I try to compile my code, I get this error:
If I remove this code, I can successfully compile my app:
init() {
UINavigationBar.appearance().barTintColor = .clear
UINavigationBar.appearance().backgroundColor = .clear; UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
UINavigationBar.appearance().shadowImage = UIImage()
}
Could someone please advice on this issue?
