Skip to content

Instantly share code, notes, and snippets.

@kobaken0029
Created December 2, 2017 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kobaken0029/3b763bec24dc588df105b6606678cb20 to your computer and use it in GitHub Desktop.
Save kobaken0029/3b763bec24dc588df105b6606678cb20 to your computer and use it in GitHub Desktop.
XcodeのPlayground上で画像を読み込みUIImageViewで表示
import UIKit
import PlaygroundSupport
let image = UIImage(named: "girl")
let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 320, height: 320))
imageView.image = image
imageView.contentMode = .scaleAspectFill
// Live Viewに表示させたいViewを渡す
PlaygroundPage.current.liveView = imageView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment