|
|
|
|
@ -153,6 +153,9 @@ struct PresetsView: View { |
|
|
|
|
|
|
|
|
|
@State var isPresented: Bool = false |
|
|
|
|
|
|
|
|
|
@State var isShowingNewCountdown = false |
|
|
|
|
@State var isShowingNewStopwatch = false |
|
|
|
|
|
|
|
|
|
var tabSelection: Binding<Int> |
|
|
|
|
|
|
|
|
|
fileprivate func _columnCount() -> Int { |
|
|
|
|
@ -175,9 +178,34 @@ struct PresetsView: View { |
|
|
|
|
|
|
|
|
|
ScrollView { |
|
|
|
|
|
|
|
|
|
Text("You can edit the duration, sound and label before adding") |
|
|
|
|
.padding() |
|
|
|
|
.font(.callout) |
|
|
|
|
VStack(alignment: .leading, spacing: 0.0) { |
|
|
|
|
Button { |
|
|
|
|
self.isShowingNewCountdown = true |
|
|
|
|
} label: { |
|
|
|
|
Text(".create countdown") |
|
|
|
|
.font(.system(.title, weight: .heavy)) |
|
|
|
|
Spacer() |
|
|
|
|
}.frame(height: 40.0) |
|
|
|
|
|
|
|
|
|
Button { |
|
|
|
|
self.isShowingNewStopwatch = true |
|
|
|
|
} label: { |
|
|
|
|
Text(".create stopwatch") |
|
|
|
|
.font(.system(.title, weight: .heavy)) |
|
|
|
|
Spacer() |
|
|
|
|
}.frame(height: 40.0) |
|
|
|
|
|
|
|
|
|
Text("You can ask Siri to create and launch countdowns and stopwatches") |
|
|
|
|
.font(.callout) |
|
|
|
|
.padding(.vertical) |
|
|
|
|
|
|
|
|
|
Text("Presets") |
|
|
|
|
.font(.system(.title, weight: .heavy)) |
|
|
|
|
|
|
|
|
|
Text("You can edit the duration, sound and label before adding") |
|
|
|
|
.font(.callout) |
|
|
|
|
|
|
|
|
|
}.padding(.horizontal) |
|
|
|
|
|
|
|
|
|
LazyVGrid( |
|
|
|
|
columns: self._columns(), |
|
|
|
|
@ -209,11 +237,19 @@ struct PresetsView: View { |
|
|
|
|
|
|
|
|
|
Spacer() |
|
|
|
|
} |
|
|
|
|
.sheet(isPresented: $isShowingNewStopwatch, content: { |
|
|
|
|
NewStopwatchView(isPresented: $isShowingNewStopwatch, tabSelection: self.tabSelection) |
|
|
|
|
.environment(\.managedObjectContext, viewContext) |
|
|
|
|
}) |
|
|
|
|
.sheet(isPresented: $isShowingNewCountdown, content: { |
|
|
|
|
NewCountdownView(isPresented: $isShowingNewCountdown, tabSelection: self.tabSelection) |
|
|
|
|
.environment(\.managedObjectContext, viewContext) |
|
|
|
|
}) |
|
|
|
|
.sheet(isPresented: $isPresented, content: { |
|
|
|
|
CountdownEditView(isPresented: $isPresented, preset: self.model.selectedPreset, tabSelection: self.tabSelection) |
|
|
|
|
.environment(\.managedObjectContext, viewContext) |
|
|
|
|
}) |
|
|
|
|
.navigationTitle("Presets") |
|
|
|
|
.navigationTitle("Create") |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|