-
-
Save classx/1d20e37a03ea9c1921212c79c5a4e93d 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