Có giải pháp cho vấn đề này không?Swift 'không có thành viên có tên'
class ViewController : UIViewController {
let collectionFlowLayout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRectZero, collectionViewLayout: collectionFlowLayout)
}
xcode mang lại cho tôi những lỗi sau
ViewController.swift: 'ViewController.Type' does not have a member named 'collectionFlowLayout'
tôi có thể làm cho nó trở thành một tùy chọn và khởi nó trong phương thức init, nhưng tôi đang tìm một cách để làm cho collectionview một let và không a var
@MehulThakkar Tôi đã thử cade của bạn trong xCode 6.1 và nó không hoạt động. – Greg