Skip to content

Instantly share code, notes, and snippets.

@aryasurya21
Last active August 4, 2022 09:55
Show Gist options
  • Save aryasurya21/0028a51c05c9adf6b35a2d83e39ab69a to your computer and use it in GitHub Desktop.
Save aryasurya21/0028a51c05c9adf6b35a2d83e39ab69a to your computer and use it in GitHub Desktop.
//
// 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