Skip to content

Commit c7fe8ff

Browse files
authored
Merge pull request #237 from TaskarCenterAtUW/fix-number-keypad-dismiss
Fix number keypad dismiss
2 parents 720a0a6 + ab3f16f commit c7fe8ff

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

GoInfoGame/GoInfoGame/Helpers/Extensions.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Foundation
99
import MapKit
1010
import RealmSwift
1111
import ARKit
12+
import SwiftUI
1213

1314

1415
// Extension to check if a polyline intersects with a coordinate
@@ -23,6 +24,13 @@ extension MKPolyline {
2324
}
2425
}
2526

27+
extension View {
28+
func hideKeyboard() {
29+
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
30+
}
31+
}
32+
33+
2634
extension CLLocationCoordinate2D: CustomPersistable {
2735

2836
public static func == (lhs: CLLocationCoordinate2D, rhs: CLLocationCoordinate2D) -> Bool {

GoInfoGame/GoInfoGame/UI/Map/ShadowOverlayRenderer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ShadowOverlayRenderer: MKOverlayRenderer {
1414
guard let shadowOverlay = overlay as? ShadowOverlay else { return }
1515

1616
let fullRect = self.rect(for: shadowOverlay.boundingMapRect)
17-
context.setFillColor(CGColor(red: 0, green: 0, blue: 0, alpha: 0.5))
17+
context.setFillColor(CGColor(red: 0, green: 0, blue: 0, alpha: 0.25))
1818
context.fill(fullRect)
1919

2020
context.setBlendMode(.clear)

GoInfoGame/GoInfoGame/quests/LongQuests/View/LongForm.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ struct LongForm: View, QuestForm {
214214
}
215215
}
216216
}
217+
.simultaneousGesture(
218+
TapGesture().onEnded {
219+
hideKeyboard()
220+
}
221+
)
217222
}
218223
.onChange(of: capturedImage) { newValue in
219224
if newValue != nil {

0 commit comments

Comments
 (0)