Bring accessibility to charts in your app

RSS for tag

Discuss the WWDC21 session Bring accessibility to charts in your app.

View Session

Posts under wwdc21-10122 tag

3 results found
Sort by:
Post not yet marked as solved
193 Views

trouble enabling two finger gesture to go back to previous page on a webview app

I have enabled the following swipe gesture and it works however with voiceover it doesnt respond and doesnt allow the user to go back with the two finger swipe from left to right Heres the code that i have written so far - import UIKit import WebKit class ViewController: UIViewController { let webView: WKWebView = { let prefs = WKWebpagePreferences() prefs.allowsContentJavaScript = true let configuration = WKWebViewConfiguration() configuration.defaultWebpagePreferences = prefs let webView = WKWebView(frame: .zero, configuration: configuration) return webView }() override func viewDidLoad() { super.viewDidLoad() view.addSubview(webView) guard let url = URL(string: "https://sindhisystems.co.uk") else { return } func goBack(_ sender: Any) { webView.goBack() } webView.load(URLRequest(url: url)) webView.customUserAgent = "iPad/Chrome/SomethingRandom" webView.allowsBackForwardNavigationGestures = true DispatchQueue.main.asyncAfter(deadline: .now()+5) { self.webView.evaluateJavaScript("document.body.innerHTML") { result, error in guard let html = result as? String, error == nil else { return } print(html) } } } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() webView.frame = view.bounds } }
Asked Last updated
.
Post not yet marked as solved
318 Views

Xcode and Firebase with Live charts/graphs

Hi all, A quick question regarding Firebase and charts. I have a database setup on Firebase that I can send pseudo-random numbers between 0 and 200 to every half second. I have a short Xcode project (<50 lines) that can observe the database, retrieve this data and output it in Xcode in realtime. Using cocoapods charts, would it be possible to be able to display this data automatically in a line chart that can update in time with the data? Displaying the random number between 0 and 200 on the y-axis and the time stamp on the x-axis? I am only new to Xcode and have not seen much online about creating live charts. Is it possible? Or does the data have to be stored and loaded into Xcode pre-charting?
Asked
by Ckeane97.
Last updated
.
Post not yet marked as solved
433 Views

Is there an equivalent accessibilityElement API for SwiftUI - specifically when making visualizations using the new Canvas view in SwiftUI

What's the most effective equivalent to the accessibilityElement API when you're creating visualizations in SwiftUI using the new Canvas drawing mechanism? When I'm drawing with Canvas, I'd know the same roughly positioning information as drawing in UIKit or AppKit and making charts visualizations, but I didn't spot an equivalent API for marking sections of the visualization to be associated with specific values. (akin to setting the frame coordinates in a UIView accessibility element) I've only just started playing with Canvas, so I may be wrong - but it seems like a monolithic style view element that I can't otherwise easily break down into sub-components like I can by applying separate CALayers or UIViews on which to hang accessibility indicators. For making the equivalent bar chart in straight up SwiftUI, is there a similar mechanism, or is this a place where I'd need to pop the escape hatch to UIKit or AppKit and do the relevant work there, and then host it inside a SwiftUI view?
Asked
by heckj.
Last updated
.