【发布时间】:2018-01-28 17:02:32
【问题描述】:
我刚刚启动了该应用,但在使用 iPhone 5 和 5c 以及 iOS 10.3.3(仅限)时遇到了问题。
我真的不明白这个问题,即使有 Crashlytics 报告:
问题似乎来自这一行:
@objc UserProfilViewController.collectionView(UICollectionView, layout : UICollectionViewLayout, sizeForItemAtIndexPath : IndexPath) -> CGSize
这是我的代码:
// Cell size
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: IndexPath) -> CGSize {
let size: CGSize
if cellIsNull == false {
size = CGSize(width: self.view.frame.size.width * 0.47, height: self.view.frame.size.width * 0.47)
} else {
size = CGSize(width: self.view.frame.size.width, height: self.view.frame.size.width * 0.47)
}
return size
}
如果我在模拟器上运行应用程序(使用 iPhone 5),应用程序不会崩溃,而且我没有 iPhone 5,所以我不对其进行测试。
【问题讨论】:
标签: ios swift swift3 crash crashlytics