release
Laurent 3 years ago
parent 26702a0e75
commit 4d10fe4ac9
  1. 2
      LeCountdown/Sound/SoundPlayer.swift
  2. 7
      LeCountdown/Views/ContentView.swift
  3. 1
      LeCountdown/Views/Countdown/CountdownFormView.swift

@ -49,7 +49,7 @@ enum SoundPlayerError : Error {
_player = try AVAudioPlayer(contentsOf: url)
_player?.prepareToPlay()
// let loopCount = repeats ? Int.max : 0
_player?.numberOfLoops = 0 //loopCount
// _player?.numberOfLoops = 0 //loopCount
_player?.volume = 1.0
_player?.delegate = self

@ -158,6 +158,11 @@ struct ContentView<T : AbstractTimer>: View {
.sheet(isPresented: $boringContext.isShowingNewData, content: {
self._newView(isPresented: $boringContext.isShowingNewData)
.environment(\.managedObjectContext, viewContext)
.onDisappear {
withAnimation {
self._buildItemsList()
}
}
})
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
@ -255,7 +260,7 @@ struct ContentView<T : AbstractTimer>: View {
}
fileprivate func _askPermissions() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { success, error in
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .criticalAlert]) { success, error in
print("requestAuthorization > success = \(success), error = \(String(describing: error))")
}
}

@ -7,7 +7,6 @@
import SwiftUI
struct CountdownFormView : View {
@EnvironmentObject var model: TimerModel

Loading…
Cancel
Save