summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/Protocols/CellFactoryProtocol.swift
blob: 5243ef576ced289fe77801943e1b1df85fbffe8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//
//  CellFactoryProtocol.swift
//  MullvadVPN
//
//  Created by Jon Petersson on 2023-03-09.
//  Copyright © 2025 Mullvad VPN AB. All rights reserved.
//

import UIKit

/// Protocol for creating factories to make ``UITableViewCell``s of various kinds.
/// Typically used in conjunction with a ``UITableViewDiffableDataSource.CellProvider``.
protocol CellFactoryProtocol {
    associatedtype ItemIdentifier

    var tableView: UITableView { get }

    func makeCell(for item: ItemIdentifier, indexPath: IndexPath) -> UITableViewCell
    func configureCell(_ cell: UITableViewCell, item: ItemIdentifier, indexPath: IndexPath)
}