Created
December 2, 2017 09:42
-
-
Save kobaken0029/3b763bec24dc588df105b6606678cb20 to your computer and use it in GitHub Desktop.
XcodeのPlayground上で画像を読み込みUIImageViewで表示
This file contains 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
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