When I try this I get error:
class ViewController: UIViewController, UIScrollViewDelegate {
......
}
extension ViewController: UIScrollViewDelegate { // Error: Redundant conformance of 'ViewController' to protocol 'UI
....
}
When I try this I don't get error:
class ViewController: UIViewController {
......
}
extension ViewController: UIScrollViewDelegate { // No error
...
}
Why do I not add UIScrollViewDelegate to ViewController when I use extension?
If a class is type of UIViewController means it conforms to UIScrollViewDelegate ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…