Resizing card for different iPhone/iPad size

How do we resizing the card for different iPhone/iPad size?
For example, attached are the images from the apps running on iPhone 8 vs iPad Pro 12.9’’. How can we resize the card automatically so that it will fill in the screen for the iPad?

And this is the image on iPhone 8, which works correctly

Hi @Khoi_Le Welcome to the community.

This is what I did to get the match game to format on the iPad

//set the width of the collectionView based on screen size
        //4 columns and 10px space between columns and 10px lead and trail
if UIDevice.current.model == "iPad" {
            let width = (view.frame.size.width - 50) / 4
            let height = (view.frame.size.height + 223) / 4
            let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout
            layout.itemSize = CGSize(width: width, height: height)