Skip to content

Commit

Permalink
fix VisualEffectView build issue for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
winddpan committed Aug 30, 2024
1 parent 9cf89d6 commit 8ecd585
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PackageDescription
let package = Package(
name: "HUD",
platforms: [
.iOS(.v14), .macOS(.v13),
.iOS(.v15), .macOS(.v12),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
Expand Down
15 changes: 2 additions & 13 deletions Sources/HUD/HUDDefaultRender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ struct HUDDefaultView: View {
}
.padding(20)
.background(
VisualEffectView(effect: UIBlurEffect(style: .systemThinMaterial))
Color.clear
.background(Material.thin)
.background(colorScheme == .light ? Color.gray.opacity(0.1) : Color.white.opacity(0.1))
.clipShape(RoundedRectangle(cornerRadius: 12))
)
Expand Down Expand Up @@ -59,15 +60,3 @@ struct HUDDefaultView: View {
}
}
}

private struct VisualEffectView: UIViewRepresentable {
var effect: UIVisualEffect

func makeUIView(context: UIViewRepresentableContext<Self>) -> UIVisualEffectView {
UIVisualEffectView()
}

func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext<Self>) {
uiView.effect = effect
}
}

0 comments on commit 8ecd585

Please sign in to comment.