Member-only story
Recreating the watchOS Breathe App with SwiftUI
Learn how to recreate the animation in the watchOS Breathe App
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)…