You can now sign in successfully and the user's information is in your app. To display the user's given name in ExploreViewController, you need to implement the prepare(for:) method in SignInViewController. This is so you can pass the user's given name to ExploreViewController and use it to set the value of the large label in headerView. Follow these steps to do so:
- Click on ExploreViewController.swift (inside the Explore folder) in the Project navigator.
- Add a property just below the class declaration:
var givenName:String?
- Modify collectionView(_:viewForSupplementaryElementOfKind:at:) so that it prints givenName to the Debug area, as follows:
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
let...