import AnimatedGradient
struct ContentView: View {
var body: some View {
AnimatedLinearGradient(colors: [.red, .green, .blue])
}
}
import AnimatedGradient
struct ContentView: View {
var body: some View {
AnimatedLinearGradient(colors: [.red, .green, .blue])
.numberOfSimultaneousColors(2)
.setAnimation(.linear(duration: 5))
.gradientPoints(start: .bottomLeading, end: .topTrailing)
}
}
colors
- An array of colors between which the gradient will transition
numberOfSimultaneousColors(Int)
- Number of colors on screen at any given time, can be more, equal or less than colors in the arraysetAnimation(Animation)
- Animation of the transition of one color to anothergradientPoints(start:end:)
- Standard linear gradient control points
You can use preselected colors from GradientPreset for a quick start
To try AnimatedGradient examples:
- Clone the repo
https://github.com/exyte/AnimatedGradient.git
- Open
Example.xcodeproj
- Try it!
dependencies: [
.package(url: "https://github.com/exyte/AnimatedGradient.git")
]
- iOS 14.0+
Grid - The most powerful Grid container
ScalingHeaderScrollView - A scroll view with a sticky header which shrinks as you scroll
AnimatedTabBar - A tabbar with number of preset animations
MediaPicker - Customizable media picker
Chat - Chat UI framework with fully customizable message cells, input view, and a built-in media picker
ConcentricOnboarding - Animated onboarding flow
FloatingButton - Floating button menu
ActivityIndicatorView - A number of animated loading indicators
ProgressIndicatorView - A number of animated progress indicators
SVGView - SVG parser
LiquidSwipe - Liquid navigation animation
PopupView - Toasts, alerts and popups library written with SwiftUI