52.7 Implementing the Coordinator
Remaining within the MyScrollView.swift file, add the coordinator class declaration so that it reads as follows:
struct MyScrollView: UIViewRepresentable {
.
.
func updateUIView(_ uiView: UIScrollView, context: UIViewRepresentableContext<MyScrollView>) {
}
class Coordinator: NSObject, UIScrollViewDelegate {
var control: MyScrollView
init(_ control: MyScrollView) {
self.control = control
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
...