-2

I am looking to add an image to the resources folder in my x-code. tutorials have me importing UIKit, but mine defaults to Cocoa, and I can't locate a UIKit.

so my coding is failing at UIImageView, and UIImage. Appreciate any guidance on how I should be writing this correctly....thnx

import Cocoa

let imageView = UIImageView()
imageView.contentMode = .scaleAspectFit
imageView.frame = CGRect(x: 0, y: 0, width: 200, height: 200)
imageView.image = UIImage(imageLiteralResourceName: "London.jpg")
Paul T
  • 25
  • 5
  • A Cocoa playground would know nothing of UIImageView, so your code makes no sense. You need to make a UIKit playground. I do not know what "I can't locate a UIKit" means. – matt Mar 27 '21 at 23:28

1 Answers1

0

figured it out. i needed to change the platform settings to iOS from macOS. that way I can import UIKit

Paul T
  • 25
  • 5