Skip to content

Instantly share code, notes, and snippets.

@thepearl
Created January 14, 2021 16:09
Show Gist options
  • Save thepearl/286cbc772ba552c16f41610be9cad0b1 to your computer and use it in GitHub Desktop.
Save thepearl/286cbc772ba552c16f41610be9cad0b1 to your computer and use it in GitHub Desktop.
Defining MoviesTableViewDiffableDataSource
import UIKit
import Combine
class MoviesTableViewDiffableDataSource: UITableViewDiffableDataSource<String?, Result> {}
class MainView: UIViewController
{
@IBOutlet weak var searchBar: UISearchBar!
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad()
{
super.viewDidLoad()
registerCell()
}
}
// MARK: - Setup UI & Cells
extension MainView
{
func registerCell()
{
let movieCell = UINib(nibName: MovieCell.reuseIdentifier, bundle: nil)
tableView.register(movieCell, forCellReuseIdentifier: MovieCell.reuseIdentifier)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment