Skip to content

Commit

Permalink
support gender setting
Browse files Browse the repository at this point in the history
  • Loading branch information
rkorzeniec committed Apr 14, 2020
1 parent b1393bd commit 469fc3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions eod/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ struct ContentView: View {

var body: some View {
VStack {
Picker(selection: $settings.gender, label: Text("Gender:")) {
Text("Male").tag(0)
Text("Female").fixedSize().tag(1)
}.pickerStyle(RadioGroupPickerStyle())

DatePicker(selection: $settings.birthDate, in: ...toDate, displayedComponents: .date) {
Text("Birth date")
}
Expand Down
4 changes: 2 additions & 2 deletions eod/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import Foundation
class Settings: ObservableObject {
@Published var birthDate: Date
@Published var birthPlace: String
@Published var gender: String
@Published var gender: Int

init() {
birthDate = Date()
birthPlace = "EUU"
gender = "male"
gender = 0
}

func birthYear() -> Int {
Expand Down

0 comments on commit 469fc3c

Please sign in to comment.