Member-only story

Recreating the watchOS Breathe App with SwiftUI

Learn how to recreate the animation in the watchOS Breathe App

ML Musings
2 min readJan 18, 2023

I have written these little pieces of code using Swift with Swift Playgrounds on an iPad

Code

struct Breathe: View {
@State var scale = false
@State var rotate = false

var body: some View {
ZStack {
Group {
ZStack {
Circle().frame(width: 80, height: 80)
.foregroundColor(Color(UIColor.systemBlue))
.offset(y: -42)
Circle().frame(width: 80, height: 80).foregroundColor(Color(UIColor.systemBlue)).offset(y: 42)
}
}.opacity(1/3)
Group {
ZStack {
Circle().frame(width: 80, height: 80).foregroundColor(Color(UIColor.systemBlue)).offset(y: -42)
Circle().frame(width: 80, height: 80).foregroundColor(Color(UIColor.systemBlue)).offset(y: 42)
}
}.rotationEffect(.degrees(60)).opacity(1/4)
Group {
ZStack {
Circle().frame(width: 80, height: 80).foregroundColor(Color(UIColor.systemBlue)).offset(y: -42)
Circle().frame(width: 80, height: 80).foregroundColor(Color(UIColor.systemBlue)).offset(y: 42)…

--

--

ML Musings
ML Musings

Written by ML Musings

✨ I enjoy pushing the boundaries of JS, Python, SwiftUI and AI. You can support my work through coffee - www.buymeacoffee.com/MLMusings

No responses yet