SSSwiftUIGIFView
SSSwiftUIGIFView is a custom controller designed to help load GIFs in SwiftUI. It supports loading GIFs from remote URLs, is compatible with both iOS and macOS, and implements a caching mechanism to improve loading times and reduce data usage.
Install / Use
/learn @SimformSolutionsPvtLtd/SSSwiftUIGIFViewREADME
SSSwiftUIGIFView
SSSwiftUIGIFView is a custom controller designed to help load GIFs in SwiftUI. It supports loading GIFs from remote URLs, is compatible with both iOS and macOS, and implements a caching mechanism to improve loading times and reduce data usage. Additionally, it provides both a default progress view and support for custom progress views while loading the GIF.
Features
- [x] Support for loading local GIFs and GIFs from remote URLs
- [x] Cache mechanism support
- [x] Cross-platform compatibility (iOS & macOS)
- [x] Custom and default progress view support
Requirements
- iOS 14.0+
- MacOS 13.0+
- Xcode 11+
Installation
CocoaPods
SSSwiftUIGIFView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SSSwiftUIGIFView'
Swift Package Manager
When using Xcode 11 or later, you can install SSSwiftUIGIFView by going to your Project settings > Swift Packages and add the repository by providing the GitHub URL. Alternatively, you can go to File > Add Package Dependencies...
dependencies: [
.package(url: "https://github.com/SimformSolutionsPvtLtd/SSSwiftUIGIFView.git", from: "2.0.0")
]
Manually
- Add
GIFCache.swift,GIFImageViewModel.swift,GIFPlayerView.swiftandSwiftUIGIFPlayerView.swiftto your project. - Grab yourself a cold 🍺.
Documentation
Documentation - Find the full API reference for more detailed documentation.
Usage example
-
Import framework
import SSSwiftUIGIFView -
Load GIF with SwiftUIGIFPlayerView function
SwiftUIGIFPlayerView(gifName: "Gif Name") -
Load GIF URL with SwiftUIGIFPlayerView function
SwiftUIGIFPlayerView(gifURL: gifURL) // Here the gifURL is a link to a GIF. -
If we want to show the default progress bar while loading a GIF
// Default value for isShowProgressView is false SwiftUIGIFPlayerView(gifURL: gifURL, isShowProgressView: true) -
If we want to show a custom progress bar while loading a GIF
SwiftUIGIFPlayerView(gifURL: gifURL) { //Custom Progress bar view }
<br> </br>
<p align="center"> <img src="demo.gif" width="40%" height="40%"/> </p> <br> </br>How to Contribute 🤝
Whether you're helping us fix bugs, improve the docs, or a feature request, we'd love to have you! :muscle: Check out our Contributing Guide for ideas on contributing.
Find this example useful? ❤️
Support it by joining stargazers :star: for this repository.
Bugs and Feedback
For bugs, feature feature requests, and discussion use GitHub Issues.
Check out our other Libraries
<h3><a href="https://github.com/SimformSolutionsPvtLtd/Awesome-Mobile-Libraries"><u>🗂 Simform Solutions Libraries→</u></a></h3>MIT License
This project is licensed under the MIT License - see the LICENSE file for details
Related Skills
openhue
338.7kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
338.7kElevenLabs text-to-speech with mac-style say UX.
weather
338.7kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
