When creating a view inside a UICollectionViewCell that should only show for a specific size class, this view is always visible on initial launch no matter what the size class.
i.e if the view should only be shown for compact width loading the app with iPhone (regular width) will also show the view until rotated.
The constraints are set as below

