Popover icon indicating copy to clipboard operation
Popover copied to clipboard

Can I add a CollectionView?

Open sergiotrejo016 opened this issue 7 years ago • 2 comments

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)`

sergiotrejo016 avatar Nov 30 '17 19:11 sergiotrejo016

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)`

Gguerrero1133 avatar Sep 13 '24 22:09 Gguerrero1133

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)`

Gguerrero1133 avatar Sep 13 '24 22:09 Gguerrero1133