Skip to content

Commit 8e5f60e

Browse files
replace opaque overlay with transparent
1 parent 2ae40fb commit 8e5f60e

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

Examples/DemosApp/DemosApp/ComponentsPreview/Helpers/ModalPreview+Helpers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct ModalPreviewHelpers {
9090
Picker("Overlay Style", selection: self.$model.overlayStyle) {
9191
Text("Blurred").tag(ModalOverlayStyle.blurred)
9292
Text("Dimmed").tag(ModalOverlayStyle.dimmed)
93-
Text("Opaque").tag(ModalOverlayStyle.opaque)
93+
Text("Transparent").tag(ModalOverlayStyle.transparent)
9494
}
9595
Picker("Size", selection: self.$model.size) {
9696
Text("Small").tag(ModalSize.small)
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
/// Defines the style of the overlay displayed behind a modal.
12
public enum ModalOverlayStyle {
3+
/// A dimmed overlay that darkens the background behind the modal.
24
case dimmed
5+
/// A blurred overlay that applies a blur effect to the background behind the modal.
36
case blurred
4-
case opaque
7+
/// A transparent overlay that leaves the background fully visible behind the modal.
8+
case transparent
59
}

Sources/ComponentsKit/Modal/SwiftUI/ModalOverlay.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct ModalOverlay<VM: ModalVM>: View {
2020
Color.black.opacity(0.7)
2121
case .blurred:
2222
Color.clear.background(.ultraThinMaterial)
23-
case .opaque:
23+
case .transparent:
2424
// Note: It can't be completely transparent as it won't receive touch gestures.
2525
Color.black.opacity(0.0001)
2626
}

Sources/ComponentsKit/Modal/UIKit/UKModalController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ open class UKModalController<VM: ModalVM>: UIViewController {
2323
self.model = model
2424

2525
switch model.overlayStyle {
26-
case .dimmed, .opaque:
26+
case .dimmed, .transparent:
2727
self.overlay = UIView()
2828
case .blurred:
2929
self.overlay = UIVisualEffectView()
@@ -165,7 +165,7 @@ extension UKModalController {
165165
switch model.overlayStyle {
166166
case .dimmed:
167167
view.backgroundColor = .black.withAlphaComponent(0.7)
168-
case .opaque:
168+
case .transparent:
169169
view.backgroundColor = .clear
170170
case .blurred:
171171
(view as? UIVisualEffectView)?.effect = UIBlurEffect(style: .systemUltraThinMaterial)

0 commit comments

Comments
 (0)