Skip to content

wangweiyang8887/ImagePreview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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.

About

SwiftUI Image Preview

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages