Created
February 23, 2021 20:18
-
-
Save karigrooms/7e3f7b6b610b13f42089597df5f352f0 to your computer and use it in GitHub Desktop.
Blog post: SwiftUI with UICollectionView - 10. Update our cell to subclass SwiftUICollectionViewCell
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
import SwiftUI | |
import UIKit | |
class MyCollectionViewCell: SwiftUICollectionViewCell<Card> { | |
static var reuseIdentifier = "MyCollectionViewCell" | |
typealias Content = Card.Content | |
func configure(with content: Content, parent: UIViewController) { | |
embed(in: parent, withView: Card(content: content)) | |
host?.view.frame = self.contentView.bounds | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment