Last active
April 22, 2019 06:23
-
-
Save iamazhar/acd174b8a4dbce6c7badc5a096729e41 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
| // MARK: - View | |
| public class BirdView: UIView { | |
| public let imageView: UIImageView | |
| public let nameLabel: UILabel | |
| public let purchaseFeeLabel: UILabel | |
| public override init(frame: CGRect) { | |
| var imageViewFrame = CGRect(x: 0, y: 16, width: frame.width, height: frame.width/2) | |
| imageView = UIImageView(frame: imageViewFrame) | |
| imageView.contentMode = .scaleAspectFit | |
| let nameLabelFrame = CGRect(x: 0, y: imageViewFrame.height + 24, width: imageViewFrame.width, height: 30) | |
| nameLabel = UILabel(frame: nameLabelFrame) | |
| nameLabel.textAlignment = .center | |
| let purchaseFeeLabelFrame = CGRect(x: 0, y: imageViewFrame.height + 46, width: imageViewFrame.width, height: 30) | |
| purchaseFeeLabel = UILabel(frame: purchaseFeeLabelFrame) | |
| purchaseFeeLabel.textAlignment = .center | |
| super.init(frame: frame) | |
| backgroundColor = .white | |
| addSubview(imageView) | |
| addSubview(nameLabel) | |
| addSubview(purchaseFeeLabel) | |
| } | |
| @available(*, unavailable) | |
| public required init?(coder: NSCoder) { | |
| fatalError("init?(coder:) is not supported") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment