Category: UIKit
-
The Delegation Pattern in Swift
The delegate pattern is a cornerstone of iOS development in UIKit, enabling a class to delegate specific tasks to another object. This pattern promotes clean and modular code by adhering to the single responsibility principle, making your apps easier to maintain and extend. If you’ve ever worked with UITableView, UICollectionView, or UITextField, you’ve already encountered…
-
Separate UITableView/UICollectionView DataSource from a View Controller in Swift
View controllers can get really massive in some cases when you place the data source and delegate methods inside it when using a tableView or a collectionView. To overcome that you can separate them out. In this article we will take a look at how we can separate the data source of tableView. A data…