Minimum changes for Xcode 11 beta 5

This commit is contained in:
John Holdsworth
2019-07-31 14:11:25 +01:00
parent 7af0a711da
commit a36ff1b7ca
48 changed files with 209 additions and 114 deletions

View File

@@ -15,7 +15,7 @@ struct ProfileEditor: View {
HStack {
Text("Username").bold()
Divider()
TextField($profile.username)
TextField("", text: $profile.username)
}
Toggle(isOn: $profile.prefersNotifications) {
@@ -25,20 +25,19 @@ struct ProfileEditor: View {
VStack(alignment: .leading, spacing: 20) {
Text("Seasonal Photo").bold()
SegmentedControl(selection: $profile.seasonalPhoto) {
ForEach(Profile.Season.allCases.identified(by: \.self)) { season in
Picker("", selection: $profile.seasonalPhoto) {
ForEach(Profile.Season.allCases, id: \.self) { season in
Text(season.rawValue).tag(season)
}
}
}.pickerStyle(SegmentedPickerStyle())
}
.padding(.top)
VStack(alignment: .leading, spacing: 20) {
Text("Goal Date").bold()
DatePicker(
$profile.goalDate,
minimumDate: Calendar.current.date(byAdding: .year, value: -1, to: profile.goalDate),
maximumDate: Calendar.current.date(byAdding: .year, value: 1, to: profile.goalDate),
"", selection: $profile.goalDate,
in: Calendar.current.date(byAdding: .year, value: -1, to: profile.goalDate)! ... Calendar.current.date(byAdding: .year, value: 1, to: profile.goalDate)!,
displayedComponents: .date
)
}

View File

@@ -17,7 +17,7 @@ struct ProfileHost: View {
HStack {
if self.mode?.value == .active {
Button(action: {
self.profile = self.draftProfile
self.draftProfile = self.profile
self.mode?.animation().value = .inactive
}) {
Text("Done")
@@ -33,7 +33,7 @@ struct ProfileHost: View {
} else {
ProfileEditor(profile: $draftProfile)
.onDisappear {
self.draftProfile = self.profile
self.profile = self.draftProfile
}
}
}

View File

@@ -22,7 +22,7 @@ struct ProfileSummary: View {
.bold()
.font(.title)
Text("Notifications: \(self.profile.prefersNotifications ? "On": "Off" )")
Text("Notifications: \(self.profile.prefersNotifications ? "Onn": "Off" )")
Text("Seasonal Photos: \(self.profile.seasonalPhoto.rawValue)")
@@ -37,7 +37,7 @@ struct ProfileSummary: View {
HikeBadge(name: "Earth Day")
.hueRotation(Angle(degrees: 90))
HikeBadge(name: "Tenth Hike")
.grayscale(0.5)
.hueRotation(Angle(degrees: 45))