refactor: Use blurred button in simulator map

This commit is contained in:
Andrea Busi
2021-03-08 21:20:38 +01:00
parent 3898eb3de2
commit 897d726ee9
2 changed files with 12 additions and 2 deletions
@@ -52,6 +52,14 @@ class AlertSimulatorViewController: UIViewController, MKMapViewDelegate {
return view
}()
private lazy var closeButton: EQNBlurredCloseButton = {
let button = EQNBlurredCloseButton()
button.translatesAutoresizingMaskIntoConstraints = false
button.addTarget(self, action: #selector(closeTapped(_:)), for: .touchUpInside)
button.setTitleColor(.darkGray, for: .normal)
return button
}()
private lazy var mapView: MKMapView = {
let map = MKMapView()
map.translatesAutoresizingMaskIntoConstraints = false
@@ -95,6 +103,7 @@ class AlertSimulatorViewController: UIViewController, MKMapViewDelegate {
private func setupUI() {
view.addSubview(mapView)
view.addSubview(closeButton)
view.addSubview(viewfinderView)
view.addSubview(calculateButton)
@@ -103,6 +112,8 @@ class AlertSimulatorViewController: UIViewController, MKMapViewDelegate {
mapView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
mapView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
closeButton.addDefaultConstraint(to: view)
viewfinderView.topAnchor.constraint(equalTo: mapView.topAnchor).isActive = true
viewfinderView.bottomAnchor.constraint(equalTo: mapView.bottomAnchor).isActive = true
viewfinderView.leftAnchor.constraint(equalTo: mapView.leftAnchor).isActive = true