summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/Views/ClearBackgroundView.swift
blob: 7f25f2e0cbbc9376fca317b6fc11d1d88d8d2ce6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import SwiftUI

struct ClearBackgroundView: UIViewRepresentable {
    func makeUIView(context: Context) -> UIView {
        return InnerView()
    }

    func updateUIView(_ uiView: UIView, context: Context) {}

    private class InnerView: UIView {
        override func didMoveToWindow() {
            super.didMoveToWindow()

            superview?.superview?.backgroundColor = .init(red: 0, green: 0, blue: 0, alpha: 0.5)
        }
    }
}