> For the complete documentation index, see [llms.txt](https://ios-course.cornellappdev.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ios-course.cornellappdev.com/course-content/lectures/l5-delegation-+-protocol.md).

# L5: Delegation + Protocol

Fall 2026

No pre-lecture reading for today either, but feel free to add songs to our [class playlist](https://open.spotify.com/playlist/3E2x17aSUHoxI7oZRm5q0g?si=16f547a9eaf34a9a\&pt=085e6afa4984e2307625df19aea18e92) while you wait :)

This is the **last UIKit lecture.** We're taking UICollectionView one step further by making the individual cells clickable, and revisiting UIView, Push/Pop, Protocols, and Delegation.

<details>

<summary>UICollectionView Follow-Along (same as last lecture)</summary>

## Using git in Terminal

#### 1. Clone the Repository

<pre class="language-sh"><code class="lang-sh"><strong>git clone https://github.com/intro-to-ios/lec5-uicollectionview.git
</strong></code></pre>

#### 2. Delete the Cell File

Remove the file in this directory: `/Views/BirdCollectionViewCell.swift/`

#### 3. Follow Along!

</details>

<details>

<summary>How to access the solution code</summary>

You have two options:

1. Through the GitHub website
   1. Go to <https://github.com/intro-to-ios/lec5-uicollectionview.git>
   2. Press the button that says main (this will show all the branches in this repo)
   3. Choose the branch `1-collectionview`&#x20;
2. Through the terminal
   1. restore your changes or stach them
      1. `git restore .` or `git stash push`
   2. Checkout to the solution branch
      1. `git checkout 1-collectionview`&#x20;
   3. Now your should have the solution code

</details>

### Lecture Slides

{% embed url="<https://docs.google.com/presentation/d/12ZlS-kE_PG-tVQ3Fiay4qFoF1vvRjwuQELusx2qcbL0/edit?usp=sharing>" %}

### Fall 2025 Lecture Video

{% embed url="<https://www.youtube.com/watch?v=5sRg_SCh2GQ>" %}

### Assignment

{% content-ref url="/pages/63gH2mOR3CyujXVErqI9" %}
[A2.5: Profile Add-On](https://ios-course.cornellappdev.com/course-content/assignments/a2.5-profile-add-on.md)
{% endcontent-ref %}
