I have build an app using XCode 7 GM (base SDK - iOS9). It works perfectly if I run it on iOS 9 Simulator but if I try to run it on iOS8 it fails here:
@IBOutlet weak var collectionView: UICollectionView!
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.title = NSLocalizedString("Home", comment: "Home")
collectionView.registerNib(UINib(nibName: "PTHomeCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "PTHomeCollectionViewCell")
}
with an error
fatal error: unexpectedly found nil while unwrapping an Optional value
because a collectionView is nil:
Of course I have doubled checked that connection in IB is established:
Could anyone please tell me why collectionView is nil here?