Post

Replies

Boosts

Views

Activity

Can't find or decode availabilityDetailedInfo warning when start editing textField
Whenever I start editing TextField or while editing TextField, Xcode shows this worning, and takes a few seconds to show the keyboard. There is no 'availabilityDetailedInfo' in my source code, and I could not find similar errors on the internet. Can't find or decode availabilityDetailedInfo unavailableReasonsHelper: Failed to get or decode availabilityDetailedInfo Can't find or decode reasons unavailableReasonsHelper: Failed to get or decode unavailable reasons as well Can't find or decode availabilityDetailedInfo unavailableReasonsHelper: Failed to get or decode availabilityDetailedInfo Can't find or decode reasons unavailableReasonsHelper: Failed to get or decode unavailable reasons as well
4
6
1.5k
Sep ’24
MapCameraPosition camera region rect item all of them are nil
@State var position : MapCameraPosition = .userLocation(fallback: .region(.defaultRegion)) Map(position: $position) {} .onAppear { Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { timer in print("check.position",position.camera,position.region,position.rect,position.item) } } All of the value are nil, so how do I get the current camera position?? check.position nil nil nil nil check.position nil nil nil nil check.position nil nil nil nil check.position nil nil nil nil check.position nil nil nil nil check.position nil nil nil nil check.position nil nil nil nil check.position nil nil nil nil It is always nil (even if I manually move around the Map with a finger)
1
0
170
Oct ’24
PHP doesn't show images in WKWebView
Since httpRequest body is ignored on WKWebView, I am trying to display a php page by fetching the data first, and displaying it. func fetchData() { URLSession.shared.dataTask(with: request) {(data, response, error) in guard let data, let url = request.url else { return } // pass the result to WKWebView }.resume() } import Foundation import SwiftUI import WebKit struct CustomWebView: UIViewRepresentable { var url: URL var data: Data func makeUIView(context: Context) -> UIView { return CustomUIWebView(url: url, data: data) } } class CustomUIWebView: UIView { let webView: WKWebView init(url: URL,data:Data) { let webConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: webConfiguration) super.init(frame: .zero) webView.load(data, mimeType: "text/html", characterEncodingName: "utf-8", baseURL: url) addSubview(webView) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func layoutSubviews() { super.layoutSubviews() webView.frame = bounds } The data contains the page that display several images, but it doesn't display any of the images in WKWebView. Test and other components (such as checkmark button) have no problem, only images do. Also, I confirmed it works fine on Safari. So what is the issue here? What am I doing wrong?
0
0
325
Jun ’24