Skip to content

A simple Water Tracker application written in pure SwiftUI and SwiftData, syncs with HealthKit and CloudKit.

License

Notifications You must be signed in to change notification settings

SteveLeungYL/WaterTracker

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

Water Tracker for iOS, iPadOS & watchOS

A simple Water Tracker application written in pure SwiftUI and SwiftData, syncs with HealthKit and CloudKit.
Report Bug · Request Feature

About The Project

This is my first time building one iOS/watchOS app using pure SwiftUI and SwiftData. The project is just for fun. Hopefully, it will benefit someone who wants to build a SwiftUI app on their own.

The app is published in the App Store, completely free of charge. No subscription; no in-app purchase; and no ads!

Features:

  • Super simple & quick drink logging.
  • Smart Water Reminder after 2 hours of each drink logging. NO REPEATED & ANNOYING reminders again and again.
  • Water Summary with 24-hour view or weekly view.
  • Data synced with, and only with CloudKit and HealthKit. No user data collected to me in any form.
  • Flexible daily goal setup.
  • Support both Milliliter and Ounce.
  • Widgets for Home Screen.
  • Support inputs from Siri and Spotlight. (phases: "Log water drinking", "Use Pocket Water Tracker to log water drinking", or the simplest "Log Water Drinking")
  • Deep integration with Apple Watch.

Screenshots

Supplementary Materials repo

iOS

iPadOS

watchOS

Roadmap

  • iOS app.
  • iPad compatibility.
  • watchOS app.
  • Widgets using WidgetKit.
    • iOS
    • watchOS
  • Water Wave animation.
  • Charts.
    • 24-hour view
    • weekly view
  • WCSession (iOS & watchOS communication)
  • Water Reminder Local Notification
  • Double Tap on watchOS to trigger drink water.
  • App Store Released. ⭐️
  • Show Empty Data or need refresh if the widget gets empty input.
  • (Bug) Widget data is out of sync if another device updates the HealthKit data. How do I correctly propagate HealthKit data when the app is not active, or even worse, when the device is locked?
    • (Partial Fix) Show data empty and prompt the user to enter the app for widget refresh.
  • Custom reminder interval.
  • App Intents.
    • Siri Integration.
    • Shortcuts Integration.
  • (Bug) Non-main thread modifying SwiftUI contents in Summary View. Not sure how.
  • Do not disturb within sleep time.
  • (Bug) The HealthKit data is not presented correctly in the first launch of the app.
  • The current CupView and SummaryView are a bit too complex. Divide them into smaller subviews.
  • A better .accessoryCorner widget, different with .accessoryCircular.
  • Swipe to drink (swipe on the CupView to trigger drink button, better with animations).
  • Unexpectedly high performance/power consumption on the wave animation (optimization).
  • Wave animation glitches at the start of the application.
    • Partially avoided by uplift waveOffset to parent view (not ideal).
  • Fix the widget recommendation name being the same for all widgets, especially on Apple Watch iOS app.

See the open issues for a full list of proposed features and known issues.

(back to top)

Contributing

Contributing is welcome, but I might not have enough time to update this app frequently. Feel free to fork this repo and implement your own features. And give me a pull request if you like.

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Yu Liang - GitHub - HomePage - [email protected]

Project Link: WaterTracker

@misc{LiangYuApple2024,
  author = {Liang, Yu},
  title = {WaterTracker},
  year = {2024},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/SteveLeungYL/WaterTracker}},
}

(back to top)

Acknowledgments

(back to top)

About

A simple Water Tracker application written in pure SwiftUI and SwiftData, syncs with HealthKit and CloudKit.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages