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
// | |
// SceneDelegate.swift | |
// ProductDetailSample | |
// | |
// Created by arya.cia on 04/08/22. | |
// | |
import UIKit | |
import ProductDetail | |
import Shared |
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 |
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
// | |
// SceneDelegate.swift | |
// MyAwesomeApp | |
// | |
// Created by digital.aurum on 10/06/22. | |
// | |
import UIKit | |
import Catalog | |
import Shared |
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
import UIKit | |
import Catalog | |
import Shared | |
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
var window: UIWindow? | |
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
import UIKit | |
import Shared | |
public class CatalogPageViewController: UIViewController { | |
@IBOutlet weak var collectionView: UICollectionView! | |
let viewModel: CatalogPageViewModel | |
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
extension CatalogPageViewController: UICollectionViewDelegate { | |
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | |
switch viewModel.data[indexPath.row] { | |
case let data as Product: | |
Router.route(.productDetailPage(productID: data)) | |
default: | |
fatalError("can't read the data") | |
} | |
} | |
} |
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
// | |
// Route.swift | |
// Shared | |
// | |
// Created by arya.cia on 04/08/22. | |
// | |
import Foundation | |
public enum Destination { |
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
// | |
// PracticeViewController.swift | |
// TPWorkshopUnitTest | |
// | |
// Created by digital.aurum on 19/11/21. | |
// | |
import UIKit | |
import Shared |
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
public override func awakeFromNib() { | |
super.awakeFromNib() | |
inspirationProductCollectionView.dataSource = self | |
inspirationProductCollectionView.delegate = self | |
let bundle = Bundle(identifier: "com.aryasurya.Shared") | |
//we could also do | |
//let bundle = Bundle(for: Self.self) since we are accessing the NIB from its own module | |
inspirationProductCollectionView.register(UINib( | |
nibName: "InspirationItemCollectionViewCell", | |
bundle: bundle), |
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
override func viewDidLoad() { | |
super.viewDidLoad() | |
title = "Catalog Page" | |
let bundle = Bundle(identifier: "com.aryasurya.Shared") | |
collectionView.register(UINib(nibName: "ProductCollectionViewCell", bundle: bundle), forCellWithReuseIdentifier: "ProductCollectionViewCell") | |
collectionView.register(UINib(nibName: "InspirationCollectionViewCell", bundle: bundle), forCellWithReuseIdentifier: "InspirationCollectionViewCell") | |
collectionView.dataSource = self | |
collectionView.delegate = self |
NewerOlder