Re: Voiceover support

2015-11-16 Thread Daniel Phillips

Hi Alex,

Thank you very much for your advice and feedback. I've subscribed to the 
accessibility mailing list now, I didn't even think about that before emailing 
my original message on here. Sorry for that!

Andrew, thank you for pointing me to RNIB, I think I may indeed be emailing 
them for some discussions.

Thank you all,
Daniel Phillips

On 14 Nov 2015 at 06:38 pm, Alex Hall  wrote:


On Nov 13, 2015, at 08:09, Daniel Phillips  wrote:

I work at Trainline on their iOS app. We had some customer feedback recently 
and unfortunately someone booked a ticket for the wrong date because we botched 
our voiceover support!
Safe to say our app as it stands is using accessibility solely for UI Testing 
purposes and any voiceover functionality is purely coincidence.

I've been adding voiceover support and my question is, to what level do you 
suggest I go with it. By which I mean, we have a lot of data on screen, 
departure times, departure station name, a label showing the duration of travel 
in an abbreviated format etc etc.

These labels could all be on say a single table view cell.

I just added support for the following: "2h 25m, direct" to read out "2 hours and 25 
minutes. Direct train."

And then I began work on the departure/arrival time. Then it hit me, I don't really know what I'm 
going for. It currently reads out something like "10:20. London. 14:36. Manchester", but 
having added a nicer support in the previous duration example, I'm tempted to have voiceover read 
something like "Departing 10:20 from London. Arriving 14:36 at Manchester"

Makes sense to me, actually. It's not what is visually there, but I'd rather 
hear that kind of description, since, as a VO user, I can't look at the top of 
the table to see which column is which. Especially when you start throwing 
times around, having clarity is great. It's also good that you've combined all 
these items into a single string, so there's no need to swipe five times just 
to read one cell.

Of course there's no limit on what you could do with this, but I wanted your 
thoughts on how far is too far. I want to make sure they get all the info, but 
is being too chatty a bad thing?

Purely from my perspective as someone who relies exclusively on VoiceOver, I think there's a difference 
between clarity/efficiency and "too far". Too far, in my view, would be presenting things that 
aren't visually there or making a whole separate interface to be presented if VO is on. It would also be 
adding way too much extra wording, such as "this train departs from London at exactly 10:00 in the 
morning". All you need is "departs London at 10:00" (obviously formatting that time to the 
user's setting). But your example is, I think, well within the realm of reasonable. You briefly, but clearly, 
describe the times and destinations, and you use punctuation to break it up and make it easier to listen to. 
Were I to read that on my phone, I wouldn't think twice about it, and I'd think what a nice job the devs did 
making it easier to use.

As I said, though, that's just me--one guy's opinion. I'd suggest two things: 
1) you may want to join accessibility-...@lists.apple.com to ask this; 2) you 
could post a forum topic on http://www.applevis.com to request feedback from a 
much wider range of people who all use VoiceOver, braille, etc. As I said, 
though, you're definitely on the right track (sorry, bad pun) with what you've 
done so far, IMHO.

Would love your feedback.

Daniel

Sent from my iPad
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/mehgcap%40icloud.com

This email sent to mehg...@icloud.com


--
Have a great day,
Alex Hall
mehg...@icloud.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

changing the name of my webview

2015-11-16 Thread Scott Berry
Hello there,

In my main storyboard I’d like to call my web view “BrowseAirports.”  How do I 
tell Xcode to do this so that when I call the code to open the web view it 
knows that my web view in storyboard is “BrowseAirports”?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: changing the name of my webview

2015-11-16 Thread Quincey Morris
On Nov 16, 2015, at 15:30 , Scott Berry  wrote:
> 
> In my main storyboard I’d like to call my web view “BrowseAirports.”  How do 
> I tell Xcode to do this so that when I call the code to open the web view it 
> knows that my web view in storyboard is “BrowseAirports”?

OS X or iOS? What do you mean by “open the web view”? On a Mac, you generally 
open windows which contain a given view. On iOS, you segue to a view controller 
that contains the view.

Probably the correct approach involves setting an outlet to the view from the 
view controller:

1. Subclass the view controller that contains the view (if you aren’t already 
using a custom subclass).

2. Add an outlet to the view controller called (say) ‘browseAirports’. Since an 
an outlet is a kind of instance variable, it’s recommended to lowercase the 
first letter.

3. In the storyboard, drag a connection from the view controller’s outlet to 
the view itself.

4. Refer to the view in code as ‘myViewController.browseAirports’.

Of course, this means you need a reference to the view controller, if you don’t 
already have one. How you do that will depend on which platform you’re using.

I don’t think there’s any reasonable way to refer to a view *by name*, since 
views don’t really have names. You can refer to views by *tag* (a numeric 
identifier), or there are other ad-hoc things you could do, such as locate the 
view at a known place in your view hierarchy (and checking it’s of the correct 
view class), but an outlet is the normal way to do something like this.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Images in NSOutlineView disappear on dataReload

2015-11-16 Thread Ken Thomases
On Nov 13, 2015, at 11:48 AM, Nick  wrote:
> 
> I've encountered a strange behavior in a source list NSOutlineView.
> Basically, whenever I call "reloadData", an image, that was set for a
> currently selected row (NSTableCellView's imageview.image), disappears (I
> set image in outlineView:viewForTableColumn:item:). When I select the row,
> the image appears again …

Source lists are a bit strange, in a couple of ways.

First, NSTableCellView does some special stuff in its override of 
-viewWillDraw.  Based on the rowSizeStyle, it will adjust the layout of the 
text field and image view.  It will also tweak their properties to match the 
standard source list style.

This layout overrides whatever is done by auto layout, at least for the current 
drawing pass, because -viewWillDraw happens after layout but before drawing.

However, in recent versions of OS X, the table cell view doesn't get redrawn as 
often as you might think.  I suspect that the use of NSVisualEffectView and a 
layer-backed view hierarchy results in the cells being drawn once into a layer 
and then refreshed from there from then on.  Changing the content of the text 
field or image view causes those subviews to redraw themselves, but does not 
cause the table cell view itself to redraw, so it doesn't repeat the layout in 
-viewWillDraw.


So, I think that you have an auto layout issue in your table cell view.  It 
results in the image view being misplaced and/or sized to (0, 0).  The table 
cell view is hiding this problem by doing manual layout, but that only happens 
on certain occasions.  In between those occasions, auto layout can kick in and 
undo what the table cell view did.

You should consider turning auto layout off for the table cell view's subviews. 
 That is, set translatesAutoresizingMaskIntoConstraints to true, set the 
autoresizingMask, set the frame (although NSTableCellView will override that 
for the text field and image view), and remove / don't add any constraints.  If 
you want to add additional subviews in your cell view, you'll need to use a 
custom subclass of NSTableCellView and override -viewWillDraw to adjust the 
layout after the superclass has had its chance.  See 

 for an example of this.  (Notice how it requires the sort of view frame 
computation that auto layout was supposed to eliminate.)


The fact that source list layout is incompatible with auto layout is the first 
bug.  The fact that it relies on -[NSTableCellView viewWillDraw] and that's no 
longer being called as often as necessary to keep the layout override in force 
is the second bug.  (Arguably, it should use an override of -layout for the 
layout parts.  I don't know where a good place would be to tweak the text field 
and image view properties.  Probably in the -setRowSizeStyle:, -setTextField:, 
and -setImageView: setters.)

Regards,
Ken


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: changing the name of my webview

2015-11-16 Thread Uli Kusterer
On 17 Nov 2015, at 00:30, Scott Berry  wrote:
> In my main storyboard I’d like to call my web view “BrowseAirports.”  How do 
> I tell Xcode to do this so that when I call the code to open the web view it 
> knows that my web view in storyboard is “BrowseAirports”?

Do you mean some name the user actually sees, or the one in Xcode's outline 
view for a XIB file? If the latter, just click the little box at the bottom and 
to the right of the bar containing all the toplevel objects of your XIB to show 
their names and the full outline, and then just double-click a name to edit it.

Or do you mean the HTML title tag?

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://stacksmith.org





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Trigger "Back to..." from code?

2015-11-16 Thread Eric Shepherd
Bummer. I was writing a Workflow script to do stuff and just wanted it
to be able to return me back to where I started when it's done, instead
of having to do it by hand. I didn't figure there was a way, but it
would have been helpful.

Daniel Phillips wrote:
> No this is all out of your control. 
>
> You'll only see that when landing in an app from another app. 

-- 

Eric "Sheppy" Shepherd
http://www.sheppyware.net/
http://www.bitstampede.org/
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UserDefaults not letting me access a dictionary?

2015-11-16 Thread Alex Hall

> On Nov 14, 2015, at 15:41, Quincey Morris 
>  wrote:
> 
> On Nov 14, 2015, at 10:18 , Alex Hall  > wrote:
>> 
>> In a playground, accessing a dictionary of [String:Bool] works fine, as 
>> expected. In the app, though, I get an error that I can't index 
>> [String:Bool] with type 'String'. I don't understand why that is, so wanted 
>> to see if there was anything special about what UserDefaults returns. In the 
>> header file it's just an optional dictionary, and my 'if let' takes care of 
>> that. I'm not sure why else my code would error out right there, though. I 
>> haven't played much with user preferences before, so I may well be missing 
>> something, but it seems easy enough to use and there shouldn't be anything 
>> funny going on. Any thoughts? Thanks!
> 
> You’ve got the types wrong. ‘dictionaryForKey’ returns type [String: 
> AnyObject]?, which means — once you’ve stripped the optionality off it — that 
> you’re trying to assign from AnyObject to Bool. The error message is 
> confusing, because it seems to be saying that your key isn’t a string, but 
> what it actually means is that a subscripting operator taking a String key 
> and returning a Bool doesn’t exist in class [String: AnyObject], and that’s 
> quite true.

Of course! I keep thinking Swift will figure out what I want AnyObject to be 
and cast for me, which is very obviously not true and not a good idea. Forcing 
a cast solved it, thanks. I'll definitely file this, as that's one of the worst 
error messages I've seen from Swift.
> 
> You should probably file a bug report about the crappy error message. To fix 
> your code you can do something like:
> 
>   someFilterSwitch.on = filter[someCategory.rawValue] as! Bool
> 
> or downcast the dictionary itself to [String: Bool].


--
Have a great day,
Alex Hall
mehg...@icloud.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com