title: Swift 2 - the behavior of the UICollectionViewFlowLayout is not defined because:
body: <p>I am using a UICollectionrView to show videos. Everything works fine except that I get a warning saying :</p>
  
  <blockquote>
    <p>2015-10-30 14:00:39.893 test[6451:90574] the behavior of the
    UICollectionViewFlowLayout is not defined because: </p>
    
    <p>2015-10-30 14:00:39.893 test[6451:90574] the item width must be less
    than the width of the UICollectionView minus the section insets left
    and right values, minus the content insets left and right values.</p>
    
    <p>2015-10-30 14:00:39.893 test[6451:90574] The relevant
    UICollectionViewFlowLayout instance is , and it is attached to ; layer = ; contentOffset: {0, 0}; contentSize: {320, 0}> collection
    view layout: . </p>
    
    <p>2015-10-30 14:00:39.894 test[6451:90574] Make a symbolic breakpoint at
    UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the
    debugger.</p>
  </blockquote>
  
  <p>This warning appears just when I reload the data inside my collectionView.</p>
  
  <p>I have tried to change width but the warning stills there.</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>var UserVideosInfo = [[String]]()
  
  override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
  
          NSNotificationCenter.defaultCenter().addObserver(self,
              selector: "reloadCollectionVideoView:",
              name: "ReloadCollectionVideoView",
              object: nil)   
      }
  
  @objc func reloadCollectionVideoView(notification: NSNotification) {
          UserVideosInfo = NSUserDefaults.standardUserDefaults().objectForKey("UserVideosJSON") as! [[String]]
          print(UserVideosInfo)
          collectionView?.reloadData()
  
      }
  
  override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
  
          if UserVideosInfo.count == 0 {
              return 0
          }else{
          return UserVideosInfo.count
          }
  
      }
  
  
  
      override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
  
          let videoCell = collectionView.dequeueReusableCellWithReuseIdentifier("VideoCell", forIndexPath: indexPath) as UICollectionViewCell
          let communityViewController = storyboard?.instantiateViewControllerWithIdentifier("community_id")
  
          videoCell.frame.size.width = (communityViewController?.view.frame.size.width)!
          videoCell.center.x = (communityViewController?.view.center.x)!
  
          return videoCell
      }
  </code></pre>