mirror of
https://github.com/Mueller-Patrick/DHBW-Service-App.git
synced 2024-11-22 17:33:57 +00:00
Adding other collected info to home view
This commit is contained in:
parent
34dc9f3a2f
commit
cacf1daf8e
|
@ -11,6 +11,8 @@ import CoreData
|
||||||
struct HomeView: View {
|
struct HomeView: View {
|
||||||
@EnvironmentObject var settings: LocalSettings
|
@EnvironmentObject var settings: LocalSettings
|
||||||
@State private var name: String = ""
|
@State private var name: String = ""
|
||||||
|
@State private var course: String = ""
|
||||||
|
@State private var director: String = ""
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
|
@ -21,8 +23,18 @@ struct HomeView: View {
|
||||||
}
|
}
|
||||||
Text("Test")
|
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{
|
}.onAppear{
|
||||||
self.readFromCoreData()
|
self.readFromCoreData()
|
||||||
}
|
}
|
||||||
|
@ -36,6 +48,8 @@ extension HomeView{
|
||||||
if(!fetchedData.isEmpty) {
|
if(!fetchedData.isEmpty) {
|
||||||
let user = fetchedData[0]
|
let user = fetchedData[0]
|
||||||
self.name = user.value(forKey: "name") as! String
|
self.name = user.value(forKey: "name") as! String
|
||||||
|
self.course = user.value(forKey: "course") as! String
|
||||||
|
self.director = user.value(forKey: "director") as! String
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user