Question: I'm developing an iOS app which includes Facebook Login, I have done the login button, but going through the Facebook Test I saw a test to ensure token validity, and if not valid, ask the user to sign in again, I would like to know how to check if a Access Token is valid or expired using Swift 3.0.

Answer: 
How about you just create a variable that creates your flow layout for you like this

```
var flowLayout: UICollectionViewFlowLayout {
    let _flowLayout = UICollectionViewFlowLayout()

    // edit properties here
    _flowLayout.itemSize = CGSize(width: 98, height: 134)
    _flowLayout.sectionInset = UIEdgeInsetsMake(0, 5, 0, 5)
    _flowLayout.scrollDirection = UICollectionViewScrollDirection.horizontal
    _flowLayout.minimumInteritemSpacing = 0.0
    // edit properties here

    return _flowLayout
}

```

And then you can set it by calling the variable.

```
self.collectionView.collectionViewLayout = flowLayout // after initializing it another way
// or
UICollectionView(frame: .zero, collectionViewLayout: flowLayout)

```
I think this will work.

```
override init(collectionViewLayout layout: UICollectionViewLayout) {
    super.init(collectionViewLayout: layout)
    collectionView?.collectionViewLayout = YourCollectionViewLayout()
}

```