Last active
April 22, 2019 06:23
-
-
Save iamazhar/d3a63972ae41bfad0bc3669eb9b52e38 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| //1 | |
| let image = UIImage(named: "swifty")! | |
| let swifty = Bird(name: "Swifty", rarity: .veryRare, image: image) | |
| //2 | |
| let viewModel = BirdViewModel(bird: swifty) | |
| //3 | |
| let frame = CGRect(x: 0, y: 0, width: 300, height: 450) | |
| let view = BirdView(frame: frame) | |
| //4 | |
| view.nameLabel.text = viewModel.name | |
| view.imageView.image = viewModel.image | |
| view.purchaseFeeLabel.text = viewModel.purchaseFeeText | |
| //5 | |
| // Present the view controller in the Live View window | |
| PlaygroundPage.current.liveView = view |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment