There's more...

Currently, our app fetches repositories from a specific, hardcoded GitHub username. It would be great, if, rather than hard coding the username, the user of the app can enter the GitHub username that the repositories will be retrieved for. So, let's add this functionality.

First, we need a way for the user to enter the GitHub username; the most appropriate way to allow a user to enter a small amount of text is through the use of UITextField.

In the main storyboard, find Text Field in the object library, drag it over to the main window, and drop it on the navigation bar of our ReposTableViewController:

Like a table view, UITextField ...

Get Swift 4 Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.