Post

Replies

Boosts

Views

Activity

How can we make elements which are grouped accessible for automation
I have a stackview which have 2 labels class TextView: UIView { @IBOutlet private weak var stackView: UIStackView! { didSet { stackView.isAccessibilityElement = true stackView.accessibilityLabel = label1.text + label2.text } } @IBOutlet private weak var label1: UILabel! { didSet { label1.accessibilityIdentifier = "label1" } } @IBOutlet private weak var: UILabel!{ didSet { label2.accessibilityIdentifier = "label2" } } } My goal here is to have a combines accessibility label for the stackview and yet able to access the accessibilityIdentifier of child elements for automation.
0
0
1k
Nov ’24
Can we see Accessibility Identifiers alone of automation elements in swift which are not accessibility Elements
I want to expose few elements for accessibility alone and other for automation alone. But I can only accessibility elements in Accessibility Inspector but can't see Automation Elements self.view.accessibilityElements = [loginButton as Any, registerButton as Any, closeButton as Any] self.view.automationElements = [claimLabel as Any, loginButton as Any, registerButton as Any, intoductionImage as Any, closeButton as Any])
1
0
501
Nov ’24
How to to expose elements for automation but not for accessibility in swift UIKit?
I have two views in a container view as below @IBOutlet weak var dataDisclosureView: UIStackView! // Main ContainerView @IBOutlet private weak var titleLabel: UILabel! { didSet { titleLabel.text = "Hello" } } @IBOutlet private weak var descriptionLabel: UILabel! { didSet { descriptionLabel.text = "World" } } @IBOutlet weak var descriptionView: UIStackView! { // sub container view containing titleLabel and descriptionLabel didSet { descriptionView.isAccessibilityElement = true descriptionView.accessibilityLabel = "Hello" descriptionView.accessibilityIdentifier = "test_hello" } } @IBOutlet private weak var requestButton: UIButton! { didSet { requestButton.isAccessibilityElement = true requestButton.accessibilityLabel = "Request Button" requestButton.accessibilityIdentifier = "test_button" } } override func viewDidLoad() { super.viewDidLoad() dataDisclosureView.isAccessibilityElement = false dataDisclosureView.accessibilityElements = [ descriptionView ?? "" ] if #available(iOS 17.0, *) { dataDisclosureView.automationElements = [ descriptionView ?? "", requestButton ?? ""] } else { // Fallback on earlier versions } let requestButtonAction = UIAccessibilityCustomAction(name: "start", target: self, selector: #selector( request)) dataDisclosureView.accessibilityCustomActions = [ requestButtonAction ] } Mx issue is I want AccessibilityIdentifers for descriptionLabel,titleLabel,requestButton and hintLabel(For Automation) and accessibility labels for descriptionView and requestButton(VoiceOver Accessibility). But I am unable to see accessibilityIdentifier for Button, TitleLabel and descriptionLabel in AccessibilityInspector. what am I doing wrong here?
1
0
416
Oct ’24
How to combine child views and expose containerView for accessibility and at the same time child views for Automation?
I have an image and label inside UIStackView which are inside a viewcontroller. I want to make my UIView accessible. So I wrote below code: var image: UIImage! var myView: UIStackView! var label : UILabel! myView.isAccessibilityElement = true myView.accessibilityLabel = "Hello" myView.accessiblityIdentifier = "test_view" image.accessiblityIdentifier = "test_image" label.accessibilityIdentifier = "test_label" All are UIKit Elements. How to expose mvView to accessibility and only children to automation I tried below two ways, none of them worked: self.view.accessibilityElements = [myView] myView.accessibilityElements = [] from apple documentation : If the object is a view and it’s an accessibility element, and accessibilityElements is empty, the system assigns the list of subviews that have an accessibilityIdentifier to automationElements. myView.automationElements = [myView,image,label] from apple documentation : In some cases, you might want to expose elements for automation but not for accessibility, or vice versa. In a view containing an image with a label under it, for example, you might choose to expose only the label for accessibility. For automation, however, you might include both the image and the label in a test to confirm the both objects exist. In this case, add both the image and the label to automationElements. I am really going crazy with this since many days. Help is very much appreciated.
0
0
357
Oct ’24
How can we add multiple apps under webcredentials in Associated domain file
I want to add my testing app and prod app for release in associated domain file. How can I add them in apple-app-site-association. Can I add both separated by coma { "webcredentials": { "apps": [ "3ABCDEF.com.lalitha.release" , 3ABCDEF.com.lalitha.test] } } In Apple documentation example they haven't mention about adding multiple apps under web credentials [https://developer.apple.com/documentation/xcode/supporting-associated-domains]
1
0
878
Jun ’24
Authorization by AEDeterminePermissionToAutomateTarget waits infinit time
I use this method to check Apple Event (Automation) permission: bool checkAuth (string : appId) { OSStatus status = noErr; if (@available(macOS 10.14, *)) { NSAppleEventDescriptor *targetAppEventDescriptor; targetAppEventDescriptor = [NSAppleEventDescriptor descriptorWithBundleIdentifier:appId.toNSString()]; status = AEDeterminePermissionToAutomateTarget(targetAppEventDescriptor.aeDesc, typeWildCard, typeWildCard, true); }return status == noErr; } The problem is that the execution freezes once in 100 times at API: AEDeterminePermissionToAutomateTarget and the user is not prompted for authorization. usage example:  checkSIPforAppIdentifier("com.microsoft.Word"); I have inserted necessary key in info.plist: <key>NSAppleEventsUsageDescription</key> <string>*** uses this feature to do do Typography actions.</string> My App is not sandboxed. PS: this issue is not consistently reproducible , once I restart the machine it works
15
0
4.4k
Nov ’20
How to print a non PDF document from MacOS using swift or shell script
Is there any framework in macOS to print a non pdf document. PDF kit is showing print panel that too only for PDF documents.Code snippet : let pdfView = PDFView() let path = URL(fileURLWithPath: "/Users/syamala/Desktop/Book1.pdf") let pdfDoc = PDFDocument(url: path) pdfView.document = pdfDoc let wnd = NSWindow() pdfView.autoScales = true pdfView.displaysPageBreaks = false wnd.setContentSize(pdfView.frame.size) wnd.contentView = pdfView pdfView.print(with: NSPrintInfo.shared, autoRotate: true)Shell command lp /Users/syamala/Desktop/Book1.pdf , even this prints only pdf docs but not non-pdf docs.Is there any swift native framework to print a document from local directory or shell command to print a document.
0
0
912
Mar ’20
None of the tccutil commands are working in Mojave(10.14.1)
In Mojave 10.14, I am able to reset Apple events using tccutil reset AppleEvents. In 10.14.1 it looks like they have upgraded this tool and USAGE isusage: tccutil [-h] [--list] [--insert INSERT] [-v] [-r REMOVE] [-e ENABLE] [-d DISABLE] [--version] [ACTION]But when i run below command, i am seeing errorstccutil --listTCC Database structure is unknown.Error opening Database.I added terminal in Full Disk Access, What else need to be done to get tccutil working ?
1
0
3.4k
Nov ’18