A beautiful, customizable SwiftUI-based glow effect that mimics Apple's Intelligence UI design language. This effect is built entirely in SwiftUI without Metal shaders, making it lightweight and easy to implement across Apple platforms.
- 🌟 Pure SwiftUI implementation - no Metal shaders required
- 📱 Cross-platform support for Apple devices
- 🎨 Fully customizable colors and animations
- ⚡️ Optimized performance with configurable parameters
- 🔄 Smooth, fluid animations
- 🎯 Easy to integrate into existing projects
- ✅ WatchOS (Complete)
- ✅ iOS (Complete)
- ⏳ iPadOS (Coming Soon)
- ⏳ macOS (Coming Soon)
Two versions available:
WatchOS.swift
: Original version (Series 10 compatible)WatchOS_WithFreeze.swift
: Enhanced version with freeze capability and full WatchOS 11 compatibility
Two stunning effects:
- Type to Siri Effect
- Apple Intelligence Glow Effect
- Copy the desired platform file (e.g.,
WatchOS.swift
orIOS.swift
) into your project - Import the file in your SwiftUI view
- Implement the effect as shown in the examples below
Adjust the animation speed and interval to match your needs:
Timer.scheduledTimer(withTimeInterval: 0.25, repeats: true) { _ in
withAnimation(.easeInOut(duration: 0.5)) {
gradientStops = GlowEffect.generateGradientStops()
}
}
Modify the gradient colors to match your app's theme:
static func generateGradientStops() -> [Gradient.Stop] {
[
Gradient.Stop(color: Color(hex: "BC82F3"), location: Double.random(in: 0...1)),
Gradient.Stop(color: Color(hex: "F5B9EA"), location: Double.random(in: 0...1)),
Gradient.Stop(color: Color(hex: "8D9FFF"), location: Double.random(in: 0...1)),
Gradient.Stop(color: Color(hex: "AA6EEE"), location: Double.random(in: 0...1)),
Gradient.Stop(color: Color(hex: "FF6778"), location: Double.random(in: 0...1)),
Gradient.Stop(color: Color(hex: "FFBA71"), location: Double.random(in: 0...1)),
Gradient.Stop(color: Color(hex: "C686FF"), location: Double.random(in: 0...1))
].sorted { $0.location < $1.location }
}
Fine-tune the effect's appearance by adjusting layer properties:
ZStack {
// Base layer with no blur
EffectNoBlur(gradientStops: gradientStops, width: 5)
.onAppear {
Timer.scheduledTimer(withTimeInterval: 0.25, repeats: true) { _ in
withAnimation(.easeInOut(duration: 0.5)) {
gradientStops = GlowEffect.generateGradientStops()
}
}
}
// Blurred overlay layer
Effect(gradientStops: gradientStops, width: 7, blur: 4)
.onAppear {
Timer.scheduledTimer(withTimeInterval: 0.3, repeats: true) { _ in
withAnimation(.easeInOut(duration: 0.6)) {
gradientStops = GlowEffect.generateGradientStops()
}
}
}
}
struct ContentView: View {
@State private var gradientStops: [Gradient.Stop] = []
var body: some View {
ZStack {
// Your content here
GlowEffect(gradientStops: gradientStops)
.onAppear {
gradientStops = GlowEffect.generateGradientStops()
}
}
}
}
struct CustomGlowView: View {
@State private var gradientStops: [Gradient.Stop] = []
var body: some View {
ZStack {
EffectNoBlur(gradientStops: gradientStops, width: 3)
Effect(gradientStops: gradientStops, width: 5, blur: 3)
}
.onAppear {
gradientStops = GlowEffect.generateGradientStops()
}
}
}
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
⭐️ If this project helped you, please consider giving it a star!