How can I check hints in Accessibility Inspector? - ios

I'm wondering if there is a way to check the hints using Accessibility Inspector? Or any other way on iOS to debug the accessibility viewing the hints? Thanks!

As far as I know, accessibility hints are not displayed in Accessibility Inspector. What I tend to do instead is run the app and then launch layout inspector. After it loads you can select the view you are interested in and see accessibility labels, traits, hints, etc.
I am not sure why hints are not displayed in AI.

Related

Mark accessibility elements as "ignored" by Accesibility Inspector

I am testing my iOS application in terms of accessibility and I am trying to reduce as many warnings as possible. Some elements, like images, I want to omit from the Voice Over, so I mark them as not accessible. However, in the Accessibility Inspector, I get the warning
"Potentially inaccessible text" - even though it is an image marked as not accessible.
Is there a way to mark some elements as "ignored" for the Accessibility Inspector such that they are not reported anymore?
Accessibility Inspector printscreen:
It is not an answer itself, but maybe you could do something similar.
I had the same issue. Setting the isAccessibilityElement to false should've done the trick but it seems to be a bug.
In my case what solved the issue was to make the container of the image an accessibility element and the warning disappeared. Doing this the inner items are going to be ignored and I think the accessibility inspector is not going to take that into account. But the isAccessibilityElement should do the same but for some reason it isn't. ;)

Accessibility Identifier not visible in Accessibility Inspector with iOS Simulator

I wanted to use the Accessibility Inspector to verify all the accessibility identifiers in my app running in the simulator (iOS 9.2).
Accessibility Inspector is able to return multiple accessibility fields but not the identifiers.
Any idea why and how I could see them ?
There is actually a way, and Chris Prince missed out on explaining how to get to it.
You start off by bringing up the inspector.
The bar above basically focuses the inspector to whatever process you need to inspect. In our case it should be simulator.
Edit: as pointed out by Dallas, you have to click on the left half revealing the possible targets. Click on the Simulator to have the Inspector target it.
Something to note that it seems that simulators have their own information to show. Focusing on the simulator will automatically add in the identifier and show the proper accessibility information.
voila!
I have only recently started using accessibility features, but at least as of Xcode9.1b2, accessibility identifiers are visible within the Accessibility Inspector. See for example:
You will never be able to (without changes from Apple) see this property in Accessibility Inspector, because it isn't really used for accessibility. That it is associated with accessibility is a misnomer, related to accessibility API's generic value in identifying elements for automated testing using UI Automation, because accessibility information is available cross process. To get this info you could cast UI elements to UIAElements and access the name property, and pass this to NSLog.
EDIT: Yep, look at Saleh's answer. Apple added this at some point! Be wary about relying on this, Accessibility Inspector has been very buggy and unstable for me recently. But that answer would be the accepted answer if you're not answering this 3 years ago!
Xcode is so flaky, sometimes the Accessibility Label or Identifier will not show in the Accessibility Inspector. When this happens I just
Set the Label and/or Identifier
Edit the display text under the Attribute Inspector, the value right under the Text selector. After doing a build I will change the value back.
Or add a IBOutlet then delete it.
If you change just the Label or Identifier Xcode does not detect it.
Make sure you have XCode opened in the background
(even though you are using Accessibility Inspector standalone app)

Accessibility order

We have a project where we want to change the order of accessibility based on the tags of the subviews. I am trying to find examples but I am not able to find any examples with swift. Can any one help me with this?
Thanks,
Shabri
We cannot change the order of accessibility. Based on DOM appearence the screen reader will read the content

How can I inspect elements on native iOS application

I am running an iOS native app on iOS Simulator and would like to inspect the elements on the app to get the ID.
Does anyone knows how this can be done?
Note: Please, this question is for iOS native App not Web based app!
Thanks
It sounds like you may be looking for something like Firebug or the Chrome Inspector for your native app? I'm not sure what you mean by "ID". Interface elements in iOS don't really have IDs the same way DOM elements have IDs.
You should check out the Spark Inspector (http://www.sparkinspector.com/), which allows you to see the views of your app and modify them at runtime - it may help you see what you're looking for. Full disclosure: I am the author of the app ;-)
There is a new app, called Reveal, that does an incredible job.
Not only you can check view's properties, you can also view all the app in a "exploded" 3D view, change the sizes and properties.
Specially for iOS 7, where the view controller starts from the beginning of the screen (and not below the navigation bar), it can be really useful.
You can download the trial at http://revealapp.com and decide which license you should get.
There are two Best ways for this -
Use Accessibility Inspector which is Apples's inbuilt tool so you don't need any other support .
As you will be using Xcode mostly for you code part, there is an option to play UI recording which capture all the actions and elements that you interact with on native app.
You need to inspect the App's Bundle.
Check this answer on stackoverflow, to get the appID: https://stackoverflow.com/a/8883166/933887
Appium has an inspector for ios applications.
This is the link for appium: http://appium.io/
and in this video you can see the inspector in action: https://www.youtube.com/watch?v=jQZTRz2W9xg

Why does the iOS Simulator show only a blank view/window?

I'm new to iOS development. I used the Interface Builder to add text fields and buttons to my view. When I run the app, the iOS Simulator only shows an empty beige screen. What am I missing? The console doesn't show any error.
It is because you have not connected your view to your File's Owner.
To do this Right Click on the View, Control Click on the Oultlet of your View and drag it to the File Owner.
This shall solve your problem.
Cheers
I reckon it's because you have AutoLayout turned on in your storyboard, but haven't set any constraints.
Follow my instructions in the following article, to confirm if this is true.
AutoLayout problem
Basically, with XCode 6, if you have AutoLayout turned on, you must set constraints on every single control... otherwise your screens will look fine within XCode, but the controls in your screen could (and will) end up anywhere and in any size when the app is run.
It's like designing a beautiful webpage, then displaying it in an angry, drunk, disorientated browser.
XCode is really unintuitive, and unhelpful for beginners... but once you learn the rules of AutoLayout (along with its many quirks), it's reasonable useful.

Resources