I need to create a specific label for braille displays in a View in SwiftUI because I want to represent an icon in braille from an image.
The accessibilityLabel value will be spoken by VoiceOver's voice but I need a braille representation to improve the UX for blind and deaf persons.
I found AXBrailleMap and AXBrailleMapRenderer but I don't find any sample code or any more detailed documentation about how to use them.
The documentation is very poor for braille display support.
I tried to include AXBrailleMapRenderer protocol in an extension of my view and in the ViewModel to use NSObject as superclass but I could not get any success.
Can anybody help me to use AXBrailleMap and AXBrailleMapRender in SwiftUI?
Thanks in advance
Related
This is a very noob question. I'm proficient in css, but swift is new to me and so I am trying to think object based, but it's not natural yet. I have tried to understand MVVM which I think is core to the problem but I'm not sure so asking for help.
I want to create an app which has an 'index' central nav type view which I have put in contentview. Depending on what button is pressed I want it to invoke series of functionality but there are up to 9 different types of function that are entirely independent of each other. In html / css, I'd have a central nav index and 'link' to other function specific capabilities.
I don't want to repeat code, so I am trying to work out how to create an architecture that supports it. Where I am getting stuck is in the scoping of it as it is telling me 'this variable isn't in scope'. Fine. I understand the concept but not how to do it right. And I've watched hundreds of hours of video and still not found anything. As an illustration, say the contentview was main actor, and it was a navigator for topics on cats, dogs, lizards, snakes, horses, and pigs.
My thinking is that I'd keep contentview as the nav, and have separate swift files cat.swift, dogs.swift, lizards.swift etc and include them into contentview so their content was globally available. In each of those files I'd have the let catName = etc and much more content specific to that function area. But then from within cat.swift I'd also want to include dog.swift, horse.swift etc as well so the user can navigate those too. In css I'd do this via links - which is probably utter idiocy in swift.
So how do I do this in swiftUI? I don't in detail know the detailed differences between #stateObject, and #state and private var versus var etc and have tried to find a guide that says 'if you want 'catModel' to be available throughout the app define it anywhere with #makeitavailableeverywhere catModel and just trigger it into the view you want by '#include catModel'.
Not sure if this makes sense, but if someone can point me to where I can get accessible, translation into how to do this I'd be so grateful. The app is nearly complete - and I'm pleased, I just can't get the different .swifts to be in scope to each other.
Thank you!
I'm building in content inside of a NSTableView, but when I compile and run, it cuts off the top half of all the content within the NSTableView. I'm brand new to the Swift language so I am quite lost here. I can provide further examples as necessary. Is there something simple I am missing first or is this more specific to my use case?
I can quickly give you a few directions to go looking for help.
Firstly the Apple Documentation for it. https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TableView/PopulatingView-TablesProgrammatically/PopulatingView-TablesProgrammatically.html
You may note that there are essentially two ways of populating the table view, programmatically by implementing the methods of NSTableViewDataSource and NSTableViewDelegate protocols. And by using Cocoa Bindings. I recommend, as a beginner, to use the first option and look at either example code or videos that use these protocols.
Secondly, this may be just a UI issue in your storyboard, make sure your constraints are set properly. You may just have some weird behavior going on here with other views.
Unfortunately, I cannot give you more help without code snippets or more information
Good day! I'm using Parse for my swift project, Specifically the PFQueryTableViewController but i want to change the loading view when i open the app. It doesn't look good in my background so i want to change its color and shadow. Also its UIActivityIndicatorView. Is it possible to change this things? Here is the Screenshot for it.
I tried searching for that method in ParseUI framework but i can't find it. I hope you can help me, Thanks!
Only the table controller is unique to Parse. The spinner is just a regular UI element. Thus, the iOS developer references are good places to look for this.
Try this link for the activity spinner:
This link shows information about the controller, which shows that it simply inherits from UITableViewController, and the cells/background can be styled accordingly.
In general, Parse tries to prefix its objects with PF.
Being new to MonoTouch this is a best practice type of question.
If in the current view I am designing in IB I am trying to showcase existing portfolio work, e.g. as on: http://www.attitudedesign.co.uk/portfolio/
And in the app I want to show 5 portfolio items in the following linear list format:
| Heading |
Text Copy |
Image |
What is the best way to go around creating this type of view?
Surely, it cant be dynamically creating Labels, Text, Images to add to the current view?
Use a UITableViewController, here is a good example. It explains all the basics of using UITableViews and the default cell styles, etc.
But in the end, you'll need to make a custom UITableViewCell to get what you want. An example of that is here.
I'd say you should check Miguel's great extension MonoTouch.Dialog on GitHub or this article in his Blog.
There are some cell templates included which may fit your needs. You may even use the ImageLoader for optimized usage of web-images.
I had no fun using UITableViews directly with custom DataSources at all.
I am wondering if there is some way to subclass UIPasteboard in order to get the selection behavior, but not get the "Cut, Copy, and Paste" options. In addition to this, is there some notification I can subscribe to that returns the NSRange of the selected body of text once it is selected?
Thanks for any help!
EDIT: I would like to use this subclass to allow the user to indicate the area that they would like to run a function on.
There are two notifications supported by UIPasteboard:
UIPasteboardChangedNotification
UIPasteboardRemovedNotification
I've looked through the relevant docs and not seen any way to get a range of the selection.
It's possible that future OS versions might give a little more support in this area.