Last active
August 4, 2022 09:55
-
-
Save aryasurya21/0028a51c05c9adf6b35a2d83e39ab69a 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
// | |
// ProductDetailPageViewController.swift | |
// MyAwesomeApp | |
// | |
// Created by digital.aurum on 10/06/22. | |
// | |
import UIKit | |
import Shared | |
public class ProductDetailPageViewController: UIViewController { | |
@IBOutlet weak var imageView: UIImageView! | |
@IBOutlet weak var productNameLabel: UILabel! | |
@IBOutlet weak var productPriceLabel: UILabel! | |
let product: Product | |
public init(product: Product) { | |
self.product = product | |
let bundle = Bundle(for: Self.self) | |
super.init(nibName: "ProductDetailPageViewController", bundle: bundle) | |
} | |
required init?(coder: NSCoder) { | |
fatalError() | |
} | |
public override func viewDidLoad() { | |
super.viewDidLoad() | |
imageView.load(url: product.imageURL) | |
productNameLabel.text = product.name | |
productPriceLabel.text = product.price | |
} | |
/* | |
// MARK: - Navigation | |
// In a storyboard-based application, you will often want to do a little preparation before navigation | |
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
// Get the new view controller using segue.destination. | |
// Pass the selected object to the new view controller. | |
} | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment