1 minute read

Building a Quotes App with UITableViewController

An iOS quotes app is a useful first UIKit project: the data is small, the screen is familiar, and every row can demonstrate layout, navigation, persistence, and accessibility without hiding the important work behind a complicated architecture for a junior developer.

UITableViewController suits that challenge because it already provides the scrolling view, data source hooks, row selection, and navigation integration. The goal is to learn how UIKit objects cooperate and how a small model becomes a reliable app rather than simply decorating a list.

For this build, I would use Swift, a programmatic UIKit interface, Codable models, local JSON storage, custom cells, search, and favourites. The finished app can also become a useful portfolio piece because every feature can be demonstrated clearly, from the first Xcode launch to an App Store release.

Choosing the right app foundation

There are several reasonable ways to present quotes. A lightweight list fits the job, a collection view supports a richer mosaic, and SwiftUI offers a short declarative path. The comparison below makes the trade-offs visible before any project files are created:

Approach Best fit Main trade-off
UITableViewController A simple, row-based quote list Limited layout flexibility
UICollectionViewController A grid or highly custom layout More configuration for basic lists
SwiftUI List Rapid development with declarative state Less direct UIKit and lifecycle practice

The quote list is deliberately conventional: one quote per row, text and attribution in each cell, and selection opening a detail screen. That structure keeps the project focused on UIKit while leaving room for custom cells, dynamic type, VoiceOver labels, categories, and sharing.

Setting up the Xcode project

In Xcode, create an iOS App project using Swift and the UIKit App Life Cycle. Choose a descriptive name, set a suitable iOS deployment target, and remove the generated storyboard and view controller files. Programmatic setup makes the ownership of each screen explicit and avoids outlets that are difficult to trace.

A useful first structure contains a Models folder for Quote, a Store folder for persistence, QuoteListViewController for the list, QuoteCell for the row design, and QuoteDetailViewController for the selected quote. Keep the navigation controller in the scene setup rather than creating another one inside the list.

let quotes = QuoteListViewController()
let navigation = UINavigationController(rootViewController: quotes)

window.rootViewController = navigation
window.makeKeyAndVisible()

This produces a conventional navigation stack. The back button, title, and transition behaviour come from UINavigationController, while each view controller remains responsible only for its own content.

Modelling quotes and saving favourites

The model should contain only the information needed to display and manage a quote. An identifier keeps selections stable, while a mutable favourite flag allows the interface to update without replacing the whole object:

struct Quote: Codable, Equatable {
    let id: UUID
    let text: String
    let author: String
    let category: String
    var isFavourite: Bool
}

For a tiny app, encode [Quote] as JSON and store it in UserDefaults under one key. Read it back with JSONDecoder; when the key is absent, decode a bundled quotes.json file, save that seed, and show it. UserDefaults is sufficient here, while Core Data or SwiftData becomes more suitable for large collections, relationships, background synchronisation, or complex queries.

Keep the bundled seed separate from user changes. New favourites and added quotes can then be saved back to local storage without rewriting the original application bundle. A small QuoteStore with load, save, and update methods keeps this work away from the view controller.

Building the quote list

UITableViewController acts as both the screen and the data source. Register QuoteCell during viewDidLoad, load the quotes from the store, and implement numberOfRowsInSection and cellForRowAt to connect each model with a visible row.

override func tableView(
    _ tableView: UITableView,
    numberOfRowsIn section: Int
) -> Int {
    quotes.count
}

override func tableView(
    _ tableView: UITableView,
    cellForRowAt indexPath: IndexPath
) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(
        withIdentifier: QuoteCell.reuseIdentifier,
        for: indexPath
    ) as! QuoteCell

    cell.configure(with: quotes[indexPath.row])
    return cell
}

QuoteCell can contain a vertical stack view with three labels: the quotation, its author, and its category. Set the quotation label to allow multiple lines, use automatic row heights, and provide an estimated height so UIKit can calculate the final size efficiently.

Reuse is one of UIKit’s most important performance features. The configuration method should replace every visible value on each call, including the favourite state, so a recycled cell never shows information from the previous quote. Selection can push a detail controller and pass the selected quote’s identifier rather than relying only on its current row number.

Adding search, editing, and favourites

UISearchController provides a familiar search field without creating a separate screen. Filtering the local array by quotation text, author, and category gives immediate results, and clearing the search restores the original list. Because the collection is small, this approach is easier to test than a remote search service.

A favourite action can be triggered from a bar button or a swipe action. Update the matching model, persist the updated array, and refresh only the affected row. Use a clear symbol such as heart.fill and provide an accessibility label that describes the action instead of relying on colour alone.

A plus button can open a dedicated quote editor with fields for the quotation, author, and category. Validate empty text before saving, trim accidental whitespace, and allow an unknown author when necessary. A swipe-to-delete action should also be available, with confirmation when deleting user-created content.

Making the experience Australian and accessible

Australian users should see familiar language and formatting. Use Australian English such as “favourite”, “colour”, and “organisation”, along with local date and time conventions. The informal word “arvo” may appear in an attributed quotation or category, but it should be explained where needed rather than treated as formal standard vocabulary.

Content can connect to Bondi Beach, Melbourne’s laneways, Uluru, or Perth’s coastline without turning those places into decorative labels. Each quotation should have accurate context and attribution. Aboriginal songlines, Dreaming stories, and traditional sayings also require care: they should never be presented as generic slogans, and appropriate community permission and cultural attribution matter.

The Australian App Store normally presents prices in Australian dollars, while Apple handles the storefront payment experience and applicable tax presentation. Australian developers also need valid payment and tax information in App Store Connect before they can receive proceeds. Testing the purchase flow in the local storefront can reveal pricing or account issues before submission.

Australia spans several time zones, from UTC+8 to UTC+10:30, and some regions change their clocks during the year. A quote-of-the-day feature should therefore use the device’s current calendar and time zone rather than assuming UTC midnight. Dynamic Type, VoiceOver labels, sufficient colour contrast, and readable Dark Mode appearance should be checked across the same content.

Testing, launching, and the lesson to keep

Unit tests can cover JSON decoding, empty-data handling, saving favourites, and filtering quotes by author or category. UI tests can launch the app, search for a known phrase, mark a favourite, add a quote, and verify that the result remains after relaunching. Xcode’s Accessibility Inspector, Dynamic Type settings, and a physical iPhone are useful before distributing a build.

TestFlight provides an effective route to real devices and small groups of testers. Before release, add a privacy description, review the displayed metadata, test the build under several screen sizes, and confirm that the bundled quotes have suitable attribution. For a student developer, a functional app built with Apple frameworks can also support a Swift Student Challenge submission, provided the current eligibility and judging rules are followed.

The lesson to keep is simple: start with a small Codable model, let UITableViewController handle the list mechanics, and make each added feature earn its place. That approach produces an app that is easy to explain, test, and maintain, while giving a junior developer a solid foundation for more advanced Apple-framework work.

Updated: