Last active
October 24, 2025 07:17
-
-
Save dterekhov/f931a25b177d647401473246ead791d0 to your computer and use it in GitHub Desktop.
New visual effects in iOS 18 #swiftui
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MeshGradient( | |
| width: 3, | |
| height: 3, | |
| points: [ | |
| [0.0, 0.0], [0.5, 0.0], [1.0, 0.0], | |
| [0.0, 0.5], [0.9, 0.3], [1.0, 0.5], | |
| [0.0, 1.0], [0.5, 1.0], [1.0, 1.0] | |
| ], | |
| colors: [ | |
| .black, .black, .black, | |
| .blue, .blue, .blue, | |
| .green, .green, .green | |
| ] | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ZStack { | |
| AnimalPhoto(image: animal) | |
| .scrollTransition(axis: .horizontal) { content, phase in | |
| content.offset(x: phase.value * -250) | |
| } | |
| } | |
| .containerRelativeFrame(.horizontal) | |
| .clipShape(RoundedRectangle(cornerRadius: 32)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ScrollView(.vertical) { | |
| VStack(spacing: 16) { | |
| ForEach(groceries, id: \.self) { grocery in | |
| RoundedRectangle(cornerRadius: 24) | |
| .fill(.purple) | |
| .frame(height: 100) | |
| .visualEffect { content, proxy in | |
| content | |
| .hueRotation(Angle(degrees: proxy.frame(in: .global).origin.y / 10)) | |
| } | |
| } | |
| } | |
| } |
Author
dterekhov
commented
Oct 20, 2025



Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment