Questions tagged [uiviewrepresentable]

229 questions
0
votes
1 answer

How to use extended function of the custom UIView in a wrapper Swift View?

(tested in Xcode 11.3, Swift 5.1.3) I want to extend UIView, wrap it with UIViewRepresentable, and use it as a Swift View. However, it is difficult for me to access extended functions of the custom UIView from the wrapper Swift View. class…
nephilim
  • 541
  • 6
  • 11
-1
votes
1 answer

How can I make my SwiftUI wrapper respect UIView size across all iOS versions?

I'm currently working on a SwiftUI wrapper for UIView and UIViewController, and my aim is to make this wrapper respect the size of the UIView and constraints. For now, I have successfully implemented the sizeThatFits method from the…
-1
votes
1 answer

Cannot find type 'UIViewRepresentable' in scope

import SwiftUI #if canImport(WebKit) import WebKit #endif struct WebView: UIViewRepresentable { var url: URL func makeUIView(context: Context) -> WKWebView { return WKWebView() } func updateUIView(_ webView: WKWebView,…
ScottyBlades
  • 12,189
  • 5
  • 77
  • 85
-1
votes
1 answer

Disable scrolling in UIViewRepresentable

I have an AAInfographics chart, that I have added to a UIViewRepresentable, and then place this in my SwiftUI view. For some reason, this is scrollable (I mean, you can drag the contents of the view up and down). The content fits the view — when you…
Joseph
  • 691
  • 4
  • 18
1 2 3
15
16