title: How to init a UICollectionView and then add layout constraint to it
body: <p>I have noticed that there is only one method to init a <code>UICollectionView</code>: </p>
  
  <pre><code>- (instancetype)initWithFrame:(CGRect)frame
           collectionViewLayout:(UICollectionViewLayout *)layout
  </code></pre>
  
  <p>But right now, I want to use auto layout to position this collection view. But it's already given a frame. Will it still work if I add layout constraint to it?</p>
  
  <p>I am adding this collection view as a subview of custom keyboard which has a view controller subclass from <code>UIInputViewController</code>. I NSLog custom keyboard view's frame. I am getting frame: {0,0},{0,0} and bounds: {0, -30},{0,30}. Why I am getting these values? I don't understand. Since these values are not valid, so if I assign the self.bounds to collection view initialization. It's not going to work. So the question is, how to add a <code>UICollectionView</code> into custom keyboard, and position it correctly?</p>