iOS Development

swiftui – iOS 16 WidgetKit Lock Display screen Animated GIFs


Beginning with iOS 16, it is attainable to show animated GIFs on the Lock Display screen utilizing WidgetKit.

Some Apps that at the moment assist this function:

I’ve tried it myself with the next code:

struct AnimatedGIFWidgetEntryView : View {
    var entry: Supplier.Entry

    var gif : UIImage {
        
        UIImage(knowledge: strive! Knowledge(contentsOf: Bundle.important.url(forResource: "test2", withExtension: "gif")!))!

    }
    
    var physique: some View {
        Picture(uiImage: gif)
    }
}

however that solely reveals the primary body of the GIF.

Am I lacking one thing?

I’ve created a pattern challenge: https://github.com/guidev/AnimatedGIF

What's your reaction?

Leave A Reply

Your email address will not be published.