Hello!
I just want to signal a bug with blur effect and iOS interface.
On my iPad Air 2, when i display my app (source code below) their is some glitches effects.
I think it is a conflict between my button's blurs and the iOS blur. The notification center and control center have a very strange behaviour.
It works very well with simulator or iPad Pro.
This is the result on the iPad Air 2.
Did I do something wrong?
import SwiftUI
struct ContentView: View {
@State private var showNewControlActionSheet = false
var body: some View {
NavigationView {
HStack {
Text("test")
}
.navigationBarTitle("Test")
.navigationBarItems(trailing: HStack() {
Button(action: {
self.showNewControlActionSheet = true
}) {
HStack {
Image(systemName: "plus")
.padding(10)
.background(VisualEffectView(effect: UIBlurEffect(style: .light)))
.clipShape(Circle())
Image(systemName: "plus")
.padding(10)
.background(VisualEffectView(effect: UIBlurEffect(style: .light)))
.clipShape(Circle())
Image(systemName: "plus")
.padding(10)
.background(VisualEffectView(effect: UIBlurEffect(style: .light)))
.clipShape(Circle())
Image(systemName: "plus")
.padding(10)
.background(VisualEffectView(effect: UIBlurEffect(style: .light)))
.clipShape(Circle())
Image(systemName: "plus")
.padding(10)
.background(VisualEffectView(effect: UIBlurEffect(style: .light)))
.clipShape(Circle())
Image(systemName: "plus")
.padding(10)
.background(VisualEffectView(effect: UIBlurEffect(style: .light)))
.clipShape(Circle())
Image(systemName: "plus")
.padding(10)
.background(VisualEffectView(effect: UIBlurEffect(style: .light)))
.clipShape(Circle())
}
}
.actionSheet(isPresented: $showNewControlActionSheet) {
ActionSheet(title: Text("Change background"), message: Text("Select a new color"), buttons: [
.default(Text("Red")) { },
.default(Text("Green")) { },
.default(Text("Blue")) { },
.cancel()
])
}
})
}.navigationViewStyle(StackNavigationViewStyle())
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
struct VisualEffectView: UIViewRepresentable {
var effect: UIVisualEffect?
func makeUIView(context: UIViewRepresentableContext<Self>) -> UIVisualEffectView { UIVisualEffectView() }
func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext<Self>) { uiView.effect = effect }
}
Thank you very much