Yet another simple image viewer for iOS Applications.
Please install by Swift Package Manager using the following URL.
https://github.com/maiyama18/ImageViewer.git
import ImageViewer
final class ViewController: UIViewController {
func showImages() {
presentImageViewer(
dataSources: [
.url("https://your/url.to.image"), // network image
.uiImage("your asset name") // asset image
],
initialIndex: 0
)
}
}
Use from SwiftUI is under developing and currently unstable. It's not working well in some situations.
struct ContentView: View {
@State private var isPresented: Bool = false
var body: some View {
VStack {
// ...
}
.imageViewer(
isPresented: $isPresented,
dataSources: [
.url("https://your/url.to.image"), // network image
.uiImage("your asset name") // asset image
],
initialIndex: 1
)
}
}