Created
June 21, 2021 18:22
-
-
Save MatrixSenpai/6a00fb63bcb52d7fb86a67fb5fdf4f3e to your computer and use it in GitHub Desktop.
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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
class MyViewController : UIViewController { | |
override func loadView() { | |
let view = UIView() | |
view.backgroundColor = .white | |
let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 150, height: 150)) | |
let url = URL(string: "https://images.contentstack.io/v3/assets/blt731acb42bb3d1659/blt1941a709e8a4a20f/609ae4787ee89a47ff53a865/WRObsidianPoro_512.jpg")! | |
let data = try? Data(contentsOf: url) | |
let image = UIImage(data: data!) | |
imageView.image = image | |
view.addSubview(imageView) | |
self.view = view | |
} | |
} | |
// Present the view controller in the Live View window | |
PlaygroundPage.current.liveView = MyViewController() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment