corin8823 / Popover

Popover is a balloon library like Facebook app. It is written in pure swift.
MIT License
2.09k stars 326 forks source link

Can I add a CollectionView? #99

Open sergiotrejo016 opened 6 years ago

sergiotrejo016 commented 6 years ago

I'm trying to add a collection view this way but cells are not being displayed. Cell is created through storyboard nib, all a get is constraints warnings in console.

` let collectionView : UICollectionView = { let layout = UICollectionViewFlowLayout() let cv = UICollectionView(frame: .zero, collectionViewLayout: layout)

        cv.delegate = self
        cv.dataSource = self
        return cv
    }()

    let nib = UINib(nibName: "CategoriesCollectionViewCell", bundle: nil)
    collectionView.register(nib, forCellWithReuseIdentifier: "CategoriesCell")

// collectionView.register(CategoriesCollectionViewCell.self, forCellWithReuseIdentifier: "CategoriesCell")

    let cvFrame = CGRect(x: 0, y: 0, width: self.view.frame.width - 60, height: self.view.frame.height  - 100)
    collectionView.frame = cvFrame

    let startPoint = CGPoint(x: self.view.frame.width - 60, y: 55)
    self.popover = Popover()
    popover.show(collectionView, point: startPoint)`