I am trying to build a simple side menu using CollectionView. The problem is that I can't get it to work because changing frame using CGRect doesn't seem to do anything and the menu won't appear. Any help would be much appreciated.

```
let blackView = UIView()
var collectionView: UICollectionView {
    let layout = UICollectionViewFlowLayout()
    let cv = UICollectionView(frame: .zero, collectionViewLayout: layout)
    cv.backgroundColor = UIColor.white
    return cv
}

func showMenu() {
    if let window = UIApplication.shared.keyWindow {

    blackView.backgroundColor = UIColor(white: 0, alpha: 0.5)
    blackView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleDismiss)))

    window.addSubview(blackView)
    window.addSubview(collectionView)

    //This line doesn't work
    collectionView.frame = CGRect(x: 0, y: 0, width: 700, height: window.frame.height)

    //This works fine
    blackView.frame = window.frame

```