GIFImage component for your SwiftUI app!

Related tags

Image swiftui-gif
Overview

SwiftUI GIF

Lightweight SwiftUI component for rendering GIFs from data or assets, with no external dependencies. As a bonus, there's an extension that loads GIFs into UIImages, as well as a UIKIt-compatible UIGIFImage class.

Preview

Installation

This component is distributed as a Swift package.

Sample usage

import SwiftUIGIF

struct GIFImageTest: View {
    @State private var imageData: Data? = nil
    
    var body: some View {
        VStack {
            GIFImage(name: "preview") // load from assets
                .frame(height: 300)
            if let data = imageData {
                GIFImage(data: data) // load from data
                    .frame(width: 300)
            } else {
                Text("Loading...")
                    .onAppear(perform: loadData)
            }
        }
    }
    
    private func loadData() {
        let task = URLSession.shared.dataTask(with: URL(string: "https://github.com/globulus/swiftui-webview/raw/main/Images/preview_macos.gif?raw=true")!) { data, response, error in
            imageData = data
        }
        task.resume()
    }
}

Recipe

For a more detailed description of the code, visit this recipe. Check out SwiftUIRecipes.com for more SwiftUI recipes!

You might also like...
Generate a list of licenses for the Swift Package libraries that your app depends on.
Generate a list of licenses for the Swift Package libraries that your app depends on.

LicenseList Generate a list of licenses for the Swift Package libraries that your app depends on. Example Requirements Written in Swift 5 Compatible w

Use `PreselectedPhotoViewController` to handle limited photo access case in your app.
Use `PreselectedPhotoViewController` to handle limited photo access case in your app.

PreselectedPhotoUI Use PreselectedPhotoViewController to handle limited photo access case in your app. Overview Supports iOS 14.0 or later How to use?

A Swift/SwiftUI utility for caching and displaying images in SwiftUI Views

A Swift/SwiftUI utility for caching and displaying images asynchronously. Built with Swift 5.5 and works with async/await.

This package integrates a UIImagePickerController into a SwiftUI app.
This package integrates a UIImagePickerController into a SwiftUI app.

This Swift Package integrates a UIImagePickerController into a SwiftUI app and allows a user to select, scale and position an image to be cropped and saved as a conatct's photo, similar to the stock iOS Contacts app.

🖼 Gallery App for Actomaton (async/await + Elm Architecture) + SwiftUI.
🖼 Gallery App for Actomaton (async/await + Elm Architecture) + SwiftUI.

🖼 Actomaton-Gallery Gallery App for Actomaton (async/await + Elm Architecture) + SwiftUI. NOTE: Most of the code are reused from Harvest-SwiftUI-Gall

A demo of face recognition SwiftUI app on iOS. Based on Vision, OpenCV, Dlib and ResNet.

iOS-FaceRecognizer A demo of face recognition SwiftUI app on iOS, build for iPad. Based on Vision, OpenCV, Dlib and ResNet. Features Add face image an

Image gallery similar to Adidias' app, built in SwiftUI
Image gallery similar to Adidias' app, built in SwiftUI

TripleStackGallery TripleStackGallery is a image gallery component, which displays a set of images as a stack of three images, always displaying the i

FlightTicketBrowser - A SwiftUI sample app for flight ticket browser
FlightTicketBrowser - A SwiftUI sample app for flight ticket browser

FlightTicketBrowser This app is a SwiftUI sample app for flight ticket browser.

SwiftUI iOS app which applies CoreML Video Matting (background removal) model to the front camera stream
SwiftUI iOS app which applies CoreML Video Matting (background removal) model to the front camera stream

CoreML Camera Video Matting This is a simple iOS app which applies Video Matting (background removal) model to the front camera stream. Video Matting

Owner
Gordan Glavaš
Gordan Glavaš
AlamofireImage is an image component library for Alamofire

AlamofireImage AlamofireImage is an image component library for Alamofire. Features Image Response Serializers UIImage Extensions for Inflation / Scal

Alamofire 3.9k Dec 29, 2022
ImageView - Component for loading and displaying different images aka SVG/PNG/JPG/JPEG

ImageView Component that loads and displays images(.svg/.png/.jpg/.jpeg) form as

Sergei 1 Mar 23, 2022
IconsMaker - Create your app icon with SwiftUI and generate PNG images in all needed sizes

IconsMaker - Create your app icon with SwiftUI and generate PNG images in all needed sizes

Jonathan Gander 14 Oct 20, 2022
Shows your photo library grouped by events, to easily export them to your computer

Groupir Shows your photo library grouped by events, to easily export them to your computer Features Currently supported features: reading your photo l

Stanislas Chevallier 0 Dec 15, 2021
Easy Tooltip for your SwiftUI Project

SwiftUI Tooltip This package provides you with an easy way to show tooltips over any SwiftUI view, since Apple does not provide one. Getting started Y

Quassum Manus 187 Jan 1, 2023
SwiftUI App Icon Generator App for iOS & macOS Catalyst

SwiftUI App Icon Generator App for iOS & macOS Catalyst Generate Asset Icons easily to your iPhone, iPad, Mac, and Apple Watch Features The app has se

Alfian Losari 21 Sep 14, 2022
Lightbox is a convenient and easy to use image viewer for your iOS app

Lightbox is a convenient and easy to use image viewer for your iOS app, packed with all the features you expect: Paginated image slideshow. V

HyperRedink 1.5k Dec 22, 2022
ImagePicker : an all-in-one camera solution for your iOS app

Description ImagePicker is an all-in-one camera solution for your iOS app. It lets your users select images from the library and take pictures at the

Özgür Odabaşı 1 Dec 1, 2021
An app show your Live Photo and export as GIF.

LivelyGIFs Show your Live Photo and export as GIF. Demo HighLights Do not use Pod or Cathage to install 3rd party library Simple logic, new learner fr

Xue Yu 95 Jun 24, 2022
PhotoEditor SDK: A fully customizable photo editor for your app.

About PhotoEditor SDK for iOS Our SDK provides tools for adding photo editing capabilities to your iOS application with a big variety of filters that

IMG.LY 116 Jan 1, 2023