I am trying to output text to viewDidLoad using a delegate (for test), however nothing happens
protocol LoaderDelegate: class {
func LoadData(_ controller: SearchPhotosViewController)
}
class LoaderData: LoaderDelegate {
func LoadData() {
print("Hello from LoaderData")
}
}
class SearchPhotosViewController: UICollectionViewController {
// MARK: - Properties
weak var delegate: LoaderDelegate?
override func viewDidLoad() {
super.viewDidLoad()
print("Hello from viewDidLoad")
delegate?.LoadData()
}
}