Skip to content

Commit ba68d16

Browse files
authored
Update README.md
1 parent 6ef5b70 commit ba68d16

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
11
# Animatable Swiftui Properties Index
22
A SwiftUI property is animatable if it can be changed to animate over time. This repo serves developers all animatable SwiftUI properties with practical and real examples. Want to know how to animate a property not listed here? No problem. Contact Amos on Twitter: @amos_gyamfi
3+
4+
------------
5+
6+
## Alignment
7+
<p align="center">
8+
<img src="https://github.com/GetStream/animatable-swiftui-properties-index/blob/main/GifPreviews/alignmentProperty.gif"/>
9+
</p>
10+
11+
```swift
12+
13+
ZStack(alignment: movingAlignment ? .topTrailing : .bottomTrailing) {
14+
Image("userAmos")
15+
.resizable()
16+
.frame(width: 56, height: 56)
17+
.clipShape(Circle())
18+
//User status: Online or offline
19+
Circle()
20+
.frame(width: 12, height: 12)
21+
.foregroundColor(onlineColor)
22+
.animation(.default.delay(1).repeatForever(autoreverses: true), value: movingAlignment)
23+
.onAppear{
24+
movingAlignment.toggle()
25+
}
26+
}
27+
```

0 commit comments

Comments
 (0)