Hi all I am new to Swift and am currently stuck on the below problem. When a row is selected on a table view controller it pushes a collection view controller but I am getting this error:
UICollectionView must be initialized with a non-nil layout parameter.
I get the error when the row is selected on tableview controller
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'UICollectionView must be initialized with a non-nil layout parameter'
Any pointer on this please?
App Delegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.makeKeyAndVisible()
window?.rootViewController = CustomTabBarController()
return true
}
Tab bar controller has been initialised with table view controller when the row is selected it should push to collection view controller
collection view cell has been registered in viewDidLoad
:
collectionView?.registerClass(PostCell.self, forCellWithReuseIdentifier: CELLID)