Skip to content

Instantly share code, notes, and snippets.

@aryasurya21
Last active July 31, 2022 08:19
Show Gist options
  • Save aryasurya21/a014fc6c844bdfc2b3dfb0cda891ca45 to your computer and use it in GitHub Desktop.
Save aryasurya21/a014fc6c844bdfc2b3dfb0cda891ca45 to your computer and use it in GitHub Desktop.
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),
forCellWithReuseIdentifier: "InspirationItemCollectionViewCell"
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment