From cacf1daf8e4db6e966e7605b9ded83ad3ad222b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Mu=CC=88ller?= Date: Tue, 22 Dec 2020 13:43:56 +0100 Subject: [PATCH] Adding other collected info to home view --- DHBW-Service/Views/Tabs/HomeView.swift | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/DHBW-Service/Views/Tabs/HomeView.swift b/DHBW-Service/Views/Tabs/HomeView.swift index a9a9ecb..b3b08a0 100644 --- a/DHBW-Service/Views/Tabs/HomeView.swift +++ b/DHBW-Service/Views/Tabs/HomeView.swift @@ -11,6 +11,8 @@ import CoreData struct HomeView: View { @EnvironmentObject var settings: LocalSettings @State private var name: String = "" + @State private var course: String = "" + @State private var director: String = "" var body: some View { VStack { @@ -21,8 +23,18 @@ struct HomeView: View { } Text("Test") - Text(self.name) - + HStack { + Text("name".localized(tableName: "General", plural: false) + ": ") + Text(self.name) + } + HStack { + Text("course".localized(tableName: "General", plural: false) + ": ") + Text(self.course) + } + HStack { + Text("director".localized(tableName: "General", plural: false) + ": ") + Text(self.director) + } }.onAppear{ self.readFromCoreData() } @@ -36,6 +48,8 @@ extension HomeView{ if(!fetchedData.isEmpty) { let user = fetchedData[0] self.name = user.value(forKey: "name") as! String + self.course = user.value(forKey: "course") as! String + self.director = user.value(forKey: "director") as! String } } }