title: (iOS) preferredLayoutAttributesFitting method did not invoke
body: <p>I use preferredLayoutAttributesFitting to dynamic my cell frame. but which confused me is , the method <code>preferredLayoutAttributesFitting</code> is not invoked at first. I have to reload my uicollectionView to invoke it.</p>
  
  <p>my code:</p>
  
  <pre><code>    override func viewDidLoad() {
      super.viewDidLoad()
  </code></pre>
  
  <p>self.recommendDatas.removeAll()</p>
  
  <pre><code>    let para = RecommendGoodsReqModel()
      para.user_id = XLD_USER_ID()
  
      Swift_API.REQUEST_MallRecommendData(parameter: para) { (resModel) in
  
          for dataModel in resModel.datas!{
  
              self.recommendDatas.append(dataModel)
  
          }
  
          self.collectionView.mj_header.endRefreshing()
          self.collectionView.reloadData()&lt;-first time reloadData
  
      }
  
  }
  </code></pre>
  
  <p>and the collectionView gave me nothing . the whole page is blank.(I have an break point in preferredLayoutAttributesFitting , not invoke) and I have method - pull down to reload :</p>
  
  <pre><code>    override func headerRefrshAction(){
  
      Swift_API.REQUEST_MallRecommendData(parameter: para) { (resModel) in
  
      for dataModel in resModel.datas!{
  
          self.recommendDatas.append(dataModel)
  
      }
  
      self.collectionView.mj_header.endRefreshing()
      self.collectionView.reloadData()&lt;-second time to reloadData
  
  }
  </code></pre>
  
  <p>totally the same code. but this time , preferredLayoutAttributesFitting had been invoked and the page shows normally . so I don't know why the method <code>preferredLayoutAttributesFitting</code> not called at first time I reload my collectionView. </p>
  
  <p>any one knows it? </p>