Skip to content

Instantly share code, notes, and snippets.

@dterekhov
Last active October 24, 2025 07:17
Show Gist options
  • Select an option

  • Save dterekhov/f931a25b177d647401473246ead791d0 to your computer and use it in GitHub Desktop.

Select an option

Save dterekhov/f931a25b177d647401473246ead791d0 to your computer and use it in GitHub Desktop.
New visual effects in iOS 18 #swiftui
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
]
)
ZStack {
AnimalPhoto(image: animal)
.scrollTransition(axis: .horizontal) { content, phase in
content.offset(x: phase.value * -250)
}
}
.containerRelativeFrame(.horizontal)
.clipShape(RoundedRectangle(cornerRadius: 32))
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))
}
}
}
}
@dterekhov
Copy link
Author

A0B4C3C2-7169-4768-AC5C-0104B6C6588B_1_105_c
7E9FCE9A-E5B1-41F0-BA21-49A5EDD499A1_1_105_c
5515A523-E81C-4768-B3B7-6E3483A3E719_1_105_c

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