diff Simoleon/Helpers/ListModifier.swift @ 77:1069c33d3a42

Added new method to show unlocked content
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Sat, 31 Jul 2021 17:09:58 +0100
parents
children 8afba86ab8dd
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Simoleon/Helpers/ListModifier.swift	Sat Jul 31 17:09:58 2021 +0100
@@ -0,0 +1,21 @@
+//
+//  ListModifier.swift
+//  Simoleon
+//
+//  Created by Dennis Concepción Martín on 31/7/21.
+//
+
+import SwiftUI
+
+struct ListModifier: ViewModifier {
+    func body(content: Content) -> some View {
+            content
+                .id(UUID())
+                .listStyle(PlainListStyle())
+                .gesture(DragGesture()
+                            .onChanged({ _ in
+                                UIApplication.shared.dismissKeyboard()
+                            })
+                )
+        }
+}