Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tiskender2/tistoryview
TIStoryView is a SwiftUI view that displays an image with a circular progress loade
https://github.com/tiskender2/tistoryview
instagram ios swiftui
Last synced: about 17 hours ago
JSON representation
TIStoryView is a SwiftUI view that displays an image with a circular progress loade
- Host: GitHub
- URL: https://github.com/tiskender2/tistoryview
- Owner: tiskender2
- License: mit
- Created: 2024-04-16T11:35:18.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-17T18:22:44.000Z (7 months ago)
- Last Synced: 2024-04-18T16:52:57.619Z (7 months ago)
- Topics: instagram, ios, swiftui
- Language: Swift
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TIStoryView
`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.
## Features
- 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## Installation
Use **Swift Package Manager**
```swift
dependencies: [
.package(url: "https://github.com/tiskender2/TIStoryView.git", exact: "1.3")
]
```## Usage
To use `TIStoryView` in your SwiftUI project, follow these steps:
1. 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.
```swift
TIStoryView(
url: URL(string: "https://example.com/image.jpg"),
gradient: Gradient(colors: [.orange, .red]),
isAnimating: $isAnimating,
tapAction: {
print("Tapped!")
}
)
```2. Customize the appearance of the loader by modifying the `gradient` and `dash` properties in the initializer.
## Example
![example](https://github.com/tiskender2/TIStoryView/assets/17899883/f4ba3db9-6354-43b8-8e32-acabec6a4aa2)Here's an example of how you can use `TIStoryView` in your SwiftUI view:
```swift
import SwiftUIstruct ContentView: View {
@State private var isAnimating = falsevar 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)
}
}
```## Requirements
iOS 15.0+