TIStoryView
is a SwiftUI view that displays an image with a circular progress loader. It supports customization of the loader's appearance, such as gradient colors and dash pattern.
- Display an image with a circular progress loader
- Customize the loader's appearance with gradient colors and dash pattern
- Tap gesture support with a callback action
Use Swift Package Manager
dependencies: [
.package(url: "https://github.com/tiskender2/TIStoryView.git", exact: "1.3")
]
To use TIStoryView
in your SwiftUI project, follow these steps:
-
Create an instance of
TIStoryView
in your SwiftUI view hierarchy and pass the necessary parameters, such as the image URL, gradient colors, and tap action.TIStoryView( url: URL(string: "https://example.com/image.jpg"), gradient: Gradient(colors: [.orange, .red]), isAnimating: $isAnimating, tapAction: { print("Tapped!") } )
-
Customize the appearance of the loader by modifying the
gradient
anddash
properties in the initializer.
Here's an example of how you can use TIStoryView
in your SwiftUI view:
import SwiftUI
struct ContentView: View {
@State private var isAnimating = false
var body: some View {
TIStoryView(
url: URL(string: "https://example.com/image.jpg"),
gradient: Gradient(colors: [.orange, .red]),
isAnimating: $isAnimating,
tapAction: {
print("Tapped!")
}
)
.frame(width: 64, height: 64)
}
}
iOS 15.0+