Created
December 30, 2020 02:26
-
-
Save jodyabney/e260b9c31478648f75276e0d237b9a9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // 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