Skip to content

Instantly share code, notes, and snippets.

@ameseee
Created August 3, 2018 02:03
Show Gist options
  • Select an option

  • Save ameseee/3dfa5117982686bb221f4b5e1dd7b03a to your computer and use it in GitHub Desktop.

Select an option

Save ameseee/3dfa5117982686bb221f4b5e1dd7b03a to your computer and use it in GitHub Desktop.
import UIKit

class PhotoDetailViewController: UIViewController {

    @IBOutlet weak var photoDetail: UIImageView!
    @IBOutlet weak var emojiLabel: UILabel!
    
    var photo : Photos?
    
    override func viewDidLoad() {
        super.viewDidLoad()

        if let realPhoto = photo {
            title = realPhoto.caption
            emojiLabel.text = realPhoto.emojiIcon
            
            if let cellPhotoImageData = realPhoto.imageData {
                if let cellPhotoImage = UIImage(data: cellPhotoImageData) {
                    photoDetail.image = cellPhotoImage
                }
            }
            
        }
    }

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment