I’m completing the online apple Xcode Tutorial. At the UIKit tutorial portion, I’m repeatedly getting the same error:
"Type 'PageViewController<Page>' does not conform to protocol 'UIViewControllerRepresentable'"
That portion of the tutorial is a few lines which are copied and pasted:
struct PageViewController<Page: View>: UIViewControllerRepresentable {
var pages: [Page]
}
How can I address this does not conform to protocol.
There are a few Does not conform to protocol errors posts online, each seemingly addressing the same error differently. Clicking fix the error adds this line to the file:
"typealias UIViewControllerType = <#type#>"
Which doesn’t address the issue since the same error occurs.
2
Answers
The additional functions are how Xcode suggested repairing the issue via the error box that appears near the error portion of the code.
You should implement the stubs too, like: