Create LICENSE
A simple SwiftUI timer view with Background, LocalNotification and Haptic support.
SwiftUI
Initialise the KSTimerView with TimeInterval and present it using .sheet or .fullScreenCover modifier or use with ZStack.
TimeInterval
.sheet
.fullScreenCover
ZStack
.sheet(isPresented: $shouldPresentTimerView, content: { KSTimerView(timerInterval: $timeInterval) })
You can customise the KSTimerView using KSTimerView.Configuration and initialise KSTimerView with your configuration.
KSTimerView.Configuration
let configuration = KSTimerView.Configuration(timerBgColor: .yellow, timerRingBgColor: .red, actionButtonsBgColor: .blue, foregroundColor: .white, stepperValue: 10, enableLocalNotification: true, enableHapticFeedback: true) KSTimerView(timerInterval: $timeInterval, configuration: configuration)
Background to foreground will be handled by default. You no need to do anything.
It is disabled by default. Enable it using enableLocalNotification in KSTimerView.Configuration.
enableLocalNotification
let configuration = KSTimerView.Configuration(..., enableLocalNotification: true, ...)
⚠️ Note: You need to get permission from user to use LocalNotification. Get it before presenting the timer view to the user.
LocalNotification
It is disabled by default. Enable it using enableHapticFeedback in KSTimerView.Configuration.
enableHapticFeedback
let configuration = KSTimerView.Configuration(..., enableHapticFeedback: true)
KSTimerView supports SPM (Swift Package Manager). You can integrate it using Xcode, File -> Swift Packages -> Add Package Dependency...
File -> Swift Packages -> Add Package Dependency...
Enter, https://github.com/karthironald/KSTimerView in repo URL.
Thanks! 👨🏻💻
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
KSTimerView
A simple
SwiftUI
timer view with Background, LocalNotification and Haptic support.Demo Video (YouTube)
Usage
Initialise the KSTimerView with
TimeInterval
and present it using.sheet
or.fullScreenCover
modifier or use withZStack
.Customisation
You can customise the KSTimerView using
KSTimerView.Configuration
and initialise KSTimerView with your configuration.Background
Background to foreground will be handled by default. You no need to do anything.
LocalNotification
It is disabled by default. Enable it using
enableLocalNotification
inKSTimerView.Configuration
.Haptic Feedback
It is disabled by default. Enable it using
enableHapticFeedback
inKSTimerView.Configuration
.Integration
KSTimerView supports SPM (Swift Package Manager). You can integrate it using Xcode,
File -> Swift Packages -> Add Package Dependency...
Enter, https://github.com/karthironald/KSTimerView in repo URL.
Contribution
Thanks! 👨🏻💻