SkillAgentSearch skills...

ImagePreview

SwiftUI Image Preview

Install / Use

/learn @wangweiyang8887/ImagePreview
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

ImagePreview for SwiftUI

A component that supports network image preview and zooming in and out of images using only SwiftUI. Also support drag and tap to dismiss.

Screenshot

<img src="https://github.com/wangweiyang8887/ImagePreview/assets/11688908/bed6da18-5b50-4441-a771-578138f14885" width="200px">

Example Usages

  1. ImagePreview
        ZStack {
            KFImage(URL(string: url))
                .resizable()
                .aspectRatio(contentMode: .fit)
                .frame(width: 200, height: 200)
                .onTapGesture {
                    withAnimation {
                        isPresented = true
                    }
                }
        }
        .overlay {
            ImagePreview(images: [ url ], currentIndex: .constant(0), isPresented: $isPresented)
        }
    

License

ImagePreview is available under the MIT license. See the LICENSE file for more info.

View on GitHub
GitHub Stars8
CategoryDevelopment
Updated1y ago
Forks0

Languages

Swift

Security Score

60/100

Audited on Mar 26, 2025

No findings