1

I am creating a chess board and want to use UICollectionView to do the grid layout. The problem is, I don't know how to set the number of columns to always be 8, so as to create a 8x8 grid.

I understand that UICollectionViewDelegateFlowLayout can be implemented to control the size of the items, but my question is will it work across all iOS devices (iPhone 4s - iPhone 6+, iPads). From what I have seen, it looks like i need to handle the size of the cells individually by each device type.

UICollectionView Set number of columns

Is anyone aware of a better solution to the problem?

Community
  • 1
  • 1
Sharath
  • 969
  • 9
  • 30
  • 3
    Possible duplicate of [UICollectionView Set number of columns](http://stackoverflow.com/questions/14674986/uicollectionview-set-number-of-columns) – 0xC0DED00D Oct 17 '15 at 18:36

1 Answers1

0

I'd forget the UICollectionView and go the a SpriteKit game. That will leave you way more control. You can even add a Game Scene in an "ordinary" iOS app.

esbenr
  • 1,356
  • 1
  • 11
  • 34