title: SwiftUI: Type does not conform to protocol 'UIViewRepresentable'
body: <p>I'm developing a new SwiftUI app and I'm trying to figure out how to make this Swift project compatible with SwiftUI:
  <a href="https://github.com/suzuki-0000/SKPhotoBrowser" rel="noreferrer">https://github.com/suzuki-0000/SKPhotoBrowser</a></p>
  
  <p>The problem is that I can't make the UIViewRepresentable work.
  I get an error:</p>
  
  <blockquote>
    <p>Type 'PhotoViewer' does not conform to protocol 'UIViewRepresentable'</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>struct PhotoViewer: UIViewRepresentable {
  
      @Binding var viewerImages:[SKPhoto]
      @Binding var currentPageIndex: Int
  
      func makeUIView(context: Context) -&gt; SKPhotoBrowser {
          let browser = SKPhotoBrowser(photos: viewerImages)
          browser.initializePageIndex(currentPageIndex)
          browser.delegate = context.coordinator
          return browser
      }
  
      func makeCoordinator() -&gt; Coordinator {
          Coordinator(self)
      }
  
      func updateUIView(_ browser: SKPhotoBrowser, context: Context) {
          browser.photos = viewerImages
          browser.currentPageIndex = currentPageIndex
      }
  
      class Coordinator: NSObject, SKPhotoBrowserDelegate {
  
          var control: PhotoViewer
  
          init(_ control: PhotoViewer) {
              self.control = control
          }
  
          func didShowPhotoAtIndex(_ browser: PhotoViewer) {
              self.control.currentPageIndex = browser.currentPageIndex
          }
  
      }
  }
  </code></pre>
  
  <p>What am I missing here?</p>