Skip to content

Instantly share code, notes, and snippets.

@jodyabney
Created December 30, 2020 02:26
Show Gist options
  • Select an option

  • Save jodyabney/e260b9c31478648f75276e0d237b9a9e to your computer and use it in GitHub Desktop.

Select an option

Save jodyabney/e260b9c31478648f75276e0d237b9a9e to your computer and use it in GitHub Desktop.
//
// CellPhotoView.swift
// MediumArticleFlickrApp
//
// Created by Jody Abney on 12/21/20.
//
import KingfisherSwiftUI
import SwiftUI
struct CellPhotoView: View {
let photo: Photo
var body: some View {
// Display the photo
KFImage(photo.remoteURL)
// set photo display characteristics
.resizable()
.aspectRatio(contentMode: .fit)
.cornerRadius(10.0)
}
}
struct CellPhotoView_Previews: PreviewProvider {
static var previews: some View {
CellPhotoView(photo: Photo.default)
.previewLayout(.sizeThatFits)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment