Giter Site home page Giter Site logo

swiftui-widgets-fitness's Introduction

Welcome! wave gif

ℹ️ What is this project?

This project will try to help you understand the basics behind SwiftUI and Combine (+ some Widgets and HealthKit!). It contains different branches that will incrementally add functionality, from the most basic state, to the addition of widgets and more configuration.

🧐 Why did I started this project?

I love Apple Fitness workout views but sadly (as today), those same views are not offered as widgets for the home screen. So I am replicating those ones, and adding the widget-capability myself. By open sourcing it, I thought It could be a great example for other developers to see how to deploy a basic structure of SwiftUI-Combine + Widgets and HealthKit with clear and concise code. Feel free to open PR or issues to improve it!

🏋️‍♀️ The workout widgets

More and more views will be included. As of today, workout views are implemented and a example widget is already done:

App demo

🧠 High level design

The main app struct Workout_CompanionApp, contains a WorkoutManager which is responsible of:

  • Gathering HealthKit authorization
  • Gathering HealthKit data
  • Providing that data through @Publishers into anyone observing

The main app inits this WorkoutManager as a @StateObject property that will be injected via environmentObject into the main view tree.

The main view will use specific publishers from the WorkoutManager to feed specific views/widgets down the UI tree. This publishers will emit specifc ViewModels for each view that needs to consume them.

Screenshot 2021-05-10 at 11 43 02

How to connect with me?

  • 🙌🏻 Say hi and add me on my LinkedIn
  • 👾 Dare to challenge me @ Fifa or Warzone!
  • 🐦 Connect on my Twitter

"It was a bright cold day in April, and the clocks were striking thirteen."


swiftui-widgets-fitness's People

Contributors

marioeguiluz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.