2020-10-07 22:10:42

Hi, I did some searching, and could not find answers to all of my questions, so I suppose I will create a new topic.

I am looking at starting IOS development. I have a mac, and am familiar enough with Voiceover. I am also aware of the limitations of Voiceover, the big one being it does not read indentation. Although, I know that there are blind programmers using a Mac. So I would like to get an idea of what is the toolchain that people are using for developing on a Mac. What is accessible and what is not. Specifically, Eclipse, VS Code, and the big one being XCode.

I am thinking of learning React Native specifically mainly because of my existing knowledge in using Javascript. I know that building games would just be not a good idea because of the limitations of React Native vursus Swift. This is mainly for building apps that are not games, so I suppose this topic could go more in the off topic room.

Is there anyone who has experience programming on a Mac and even better building IOS apps on a Mac using React Native who could share the tools they use and processes for compiling, running, and then sideloading apps using a free Apple developer account. At the moment I do not intend on paying the $100 for the ability to post apps in the app store, this is mainly for educational purposes.

Thanks,

timothy Breitenfeldt

2020-10-09 16:26:28

My response won't be of any help, but I sincerely hope you will eventually get an answer from some successful iOS developers. I know there's at least one, so it can be done. I want to get into iOS development too, but honestly, I'm a bit scared off by all the visual programming I will have to potentially do, and perhaps even fearful of the Apple way of doing things. I guess it may be up to me to actually get my hands dirty if I can finally boot my Mac OS. Funny, I have a Mac, but I only use Windows on it, and am quite content with this solution!

2020-10-09 19:11:22

Thank you for the input, I posted a similar question on the blind programmers mailing list, and learned a couple things. I would definitely still appreciate the advice of someone who knows more though.

From my understanding, Eclipse and VS Code are pretty accessible on Mac with Voiceover. The big one being XCode, which is definitely accessible now.

The first things you have to do is configure Voiceover. I have seen many posts about Voiceover not reading indentation on this form, and that was my initial experience as well, although Voiceover can do more, at least more than I thought. If you open Voiceover utilities (function plus control + options plus 8), and select the verbosity tab, you can crank the verbosity to high. You will also need to go into the speech tab and set Voiceover to read all symbols. For whatever reason, all symbols, is not actually all symbols, which is why you have to crank up the verbosity. The second part is to go into verbosity and click on the text subtab, go over to "when text attributes change" and pull that menu down and select do nothing. This turns off the rather irritating side affect of cranking up the verbosity to high, which is that Voiceover reads text color, style, font, etc... However, Voiceover is still not reading indentation. You have to go back to the main Verbosity tab, insuring that the speech subtab is selected, and go over to customize your verbosity. You can then get into the table, and select the text row. You want to change text from default to high. This will force Voiceover to start reading indentation. Now, it is not great, rather than quantifying spaces or tabs, it reads them individually. So, 3 tabs reads as,
tab tab tab
and 4 spaces read as
space space space space
Someone mentioned that they were able to force Voiceover to recognise 4 spaces as tab, which reduces some of the chatter, but it is definitely not great. I don't recommend trying to program in Python on Mac with this. Although, this is far better than anything I have heard from anyone else so far.

I did hear that supposedly the next version of the Mac OS might include a feature for Voiceover to read indentation. It was on some podcast someone heard. We can only hope.

I will paste in the shortcuts that were given to me for XCode, as well as the description on how to sideload apps. I have not gotten as far as to try everything, I have been trying to get home brew, NVM, NPM, and React installed first.

However, the one thing I still have not gotten an answer on is if XCode supports auto formatting either through a key command, or ideally on save. I started thinking, when programming on Windows, most of the time when I am not programming in Python, I just let the IDE, either VS Code or Eclipse, manage my indentation for me when I do control plus s. It auto formats my code which includes fixing indentation for me. If that can be set up in XCode, then I would have to say there is no problem programming on Mac, at least standing on this side of the fence. We will see how I feel once I get going.

XCode Commands:
command 1 to go to project navigator
command 5 to issue navigator
command J to jump to the selected file/section
command T to create a new tab, to have multiple files open
up and down arrows to navigate auto suggestions, and VO space to accept a suggestion
VO J will jump from region to region allowing you to explore without memorizing the commands above
command r to run a project, it will open a simulator by default, which is workable but much more laggy than using an iOS device, although enough for small tests

Sideloading:
To run apps on the device you have to create a developer account in the site, there is a free variant and you can use your Apple id. You have to use it on your XCode preferences and use it on the projects you create.

To side load into the iPhone you connect the iPhone using a cable and go to the Product menu - destination and chose your iPhone from the list of devices. Then you run and it will try to run on the iPhone.
On the iPhone it loads the app but won't open it until you go to an option that appears on settings - general (device management I think) and authorize your development profile.
Than it will run, but you can't have more than 3 apps on each device with the free account. You will have to uninstall one of the 3 apps you have sideloaded before you can sideload another. This does not include just updating an app though, you can do that all day from my understanding.

If anyone can add to this that would be great. I hope this helps someone else too. I am going to get started today working on learning XCode.

Timothy Breitenfeldt

2020-10-10 00:07:34

So, I have been trying to get started, and one of the first things I learned is that Xcode, as far as I can tell does not support writing Javascript. So, I had to download VS Code, which  is pretty much the same as on Windows, just replace all of your keyboard commands that use control with command, and it functions the same. I have not ran into any accessibility issues yet. I also learned that there is a react native extension for VS Code that provides support for running your React Native project in an emulator from inside  VS Code . I think it even provides support for deploying to a phone. It must interface with the Xcode API.

2020-10-10 00:39:53

smile You got that right.
Xcode, while vast, is mostly meant for apps in Swift and Objective-C. Unlike Visual Studio IDE on Windows, it never really branched out to cover JavaScript, Python and other languages perhaps except for C++, although I haven't looked at Xcode for quite some time so I don't remember off the top of my head.
Vs Code is cross-platform and will work with ReactNative. React-Native, to build on iOS however, still needs a mac and I do believe it talks to the commandline toolchain that xCode also uses under the hood in some fashion, although I do not know the specifics of that exactly. smile

2020-10-10 01:57:45

Also, not sure if you know this or if it's still true (if it's not, I'd like to know) but I don't think emulators are accessible. So you'll need to test on-device.

2020-10-10 04:15:11

Hi

If you do not want to use a mac for IOS App development in React Native, I'd recommend getting Expo on your machine. It is a CLI that abstracts away the complications of the basic React Native CLI, and does all of the code compilation and building on its own servers. That's why, with an Apple ID that is authenticated with Apple's developer servers, it will get you an IPA build in no time.

Founder and Managing director of Vidyadrishti.
Check us out on twitter at https://twitter.com/vidya_drishti
Check us out on instagram at https://instagram.com/vd.vidyadrishti
Check my YouTube channel out at https://youtube.com/c/techwithphoenix

2020-10-10 04:19:34

Also, sorry to double post, but this is to post 4. I'd say also get the expo CLI, or if you're just starting in React Native, the create-react-native-app CLI, and use the terminal as much as possible instead of just using keyboard shortcuts and menu options to run and deploy to the phone. Emulators will not help you, at least not now. Now, if you wanted to develop for android, it'd be a bit easier with a VM, but unfortunately, that's not the case for MacOS.

Founder and Managing director of Vidyadrishti.
Check us out on twitter at https://twitter.com/vidya_drishti
Check us out on instagram at https://instagram.com/vd.vidyadrishti
Check my YouTube channel out at https://youtube.com/c/techwithphoenix

2020-10-10 19:41:13

Thank you for the responses. If you are using Expo on Windows, it sounds like you could build your app, but how would you transfer it to a IOS phone?

2020-10-11 00:48:20

From the quick look I took, you link your phone up to your Expo account, and through that your phone gains access to the generated builds. How it works exactly I don't know, though smile

2020-10-12 04:15:08

Hi

To test it on your phone, you can download the expo client and scan a QR code that appears on the screen.
If you want the build, expo gives you an option to E-Mail you the link to it. You can then download it onto your IOS Phone. However, note that IPA Files need some extra steps done to run on IOS. Thus, I would advise you to use the Expo app on the phone and scan the QR code. That way, your app will also reload in the background.

Here are the steps:
1: cd into the directory of your react native project
2: Type npm start or yarn start to start up the local hosting server of the app.
3: On your phone, go into the camera app, with the expo app installed, and scan the printed QR Code. Note: you may need a bit of sighted help. I'd consider using Be My Eyes here.
4: Every time you make a change to any of the files in the project directory and save it, the instance of your app will reload on your phone to reflect the changes.
5: To shut down the server, simply press ctrl+c or command+c, depending on your operating system.

HTH.

Founder and Managing director of Vidyadrishti.
Check us out on twitter at https://twitter.com/vidya_drishti
Check us out on instagram at https://instagram.com/vd.vidyadrishti
Check my YouTube channel out at https://youtube.com/c/techwithphoenix

2020-10-12 16:45:31

I don't have any input on programming in react native, but I used Xcode for my computer science courses that were c++ based; as well as recently some swift and swift based iOS app programming. The key commands above are very good and work memorizing those and others so you are not navigating the UI. To those people that are scared of getting into iOS app development because you think there is lots of visual laying out of UI elements in the interface builder, this is not true if you use SwiftUI. SwiftUI isn't perfect and you can't do everything in it yet, but it is well on the way of completely replacing UIKit and AppKit on iOS and MacOS respectively. I am in the process of working on a couple apps written completely in SwiftUI and have have not once needed to use the interface builder. Yes you could previously procedurally generate UI elements with swift or objectiveC, but Swift with SwiftUI is an amazingly simple, intuitive, and powerful way to write your app.
I have been using Paul Hudson's 100 days of SwiftUI course. This can be found at https://www.hackingwithswift.com/100/swiftui
Hope this helps

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

2020-10-12 16:49:58

This is some good reference material right in this post! It comforts me that some of you are having some success. I know React professionally, so I might even give React Native a try, and gradually move to Swift! This post should be Stickied.

2020-10-12 18:56:40 (edited by TJ.Breitenfeldt 2020-10-12 19:04:08)

Hi, thank you for the responses. I have gotten my hands dirty now. I got Expo installed on my phone and the Cli installed on my mac. You don
't actually have to scan a QR code. As long as you have the Expo app, on your phone, all you have to do is start your project with
expo start
it will open up a browser, find the link that says "publish or Republish" and activate it. On your expo app on your phone, select the projects tab, and it should automatically load the project for you as long as you are connected to the same wireless network as your computer. Click on the project on your phone, and it just opens your app and works, well... on a good day when there are no errors. You can just start coding from there, and it will automatically refresh on your IPhone on save. It seems like it is not always refreshing on save, so sometimes you have to go to your phone, shake it to get back into the Expo menu, and click reload, which rebuilds the project as you can observe on your terminal on your computer.
note: I am actually not sure if the auto refresh behavior on save is occuring because it is built into Expo, or if it is because I installed watchman. Some tutorial told me to install watchman, and did not explain much what it would do for me.

I have been using Visual Studio code, and have set it up to auto format on save using the prettier Javascript extension, so managing indentation is not a problem.

I do have a couple things to say about Visual Studio on a Mac though. If you have used VS Code on Windows, then it is pretty much the same on Mac, just replace all of your commands you would normally use control for, with command. Now, there seems to be two main Voiceover bugs I have noticed, the first is pretty easy to deal with, Voiceover is not reading tabs at all even though in text edit it is giving me the behavior I described above, where Voiceover reads the tab and space characters individually. This is not a big deal since Voiceover wasn't reading indentation anyways, and like I mentioned, format on save fixes this issue.
The second problem is a bit more frustrating. I find that The VS Code editor does not track the Voiceover cursor well, or vise-versa. If you right arrow over a few characters, and then left arrow, Voiceover seems to skip over characters. It is very strange. I have not pin pointed the exact behavior, weather Voiceover is just reading the character, even though the cursor is in the correct spot, or if the cursor is completely jumping characters. I believe that it is the latter, where the cursor is jumping based on my experience with backspacing when this happens. You can fix this by just left arrowing a few more characters and right arrowing back, and it should read just fine now. So perhaps it has to do with the left arrow navigation? I am not sure. This is perhaps something that should be mentioned to the VS Code devs if other people are having this problem.

2020-10-13 04:36:08

Hi

About the expo app, that reloading bug has happened on android as well. It's more to do with expo's client and the way it communicates with the local server you set up every time you run expo start or npm start.

About the bug in VS Code, I have unfortunately noticed the same thing. Now, I have talked to microsoft about this, when I met a few officials at a hackathon, and we are working on a fix together. If nothing else, we'll be able to come up with an extention by 2021.

Founder and Managing director of Vidyadrishti.
Check us out on twitter at https://twitter.com/vidya_drishti
Check us out on instagram at https://instagram.com/vd.vidyadrishti
Check my YouTube channel out at https://youtube.com/c/techwithphoenix

2020-10-13 18:50:45

That is great news. I hoep Microsoft can figure out what is wrong and get a update pushed out.  Thanks for initiating that conversation.

I actually have another problem I am tackling now, and perhaps I should just start a new thread for this, but here we go.
I am working on a app for my sister for playing the Kalimba on the phone. There are tuns of piano apps out there, and at least one that is accessible here:

https://www.applevis.com/apps/ios/music/piano

I have already built up the foundations of the app in react native, I am trying to implement the Kalimba itself now though and running into a problem. I need to enable Voiceover to bypass the normal double tap activation feature for everything, and get direct touch working so that when you press a key on the kalimba on the screen, it will make a sound immediately rather than forcing you to double tap.
So, to clarify a couple things, my sister is also blind and uses Voiceover, so I would rather build this for Voiceover users rather than just say, turn Voiceover off to use this app.
There are other reasons for future features that I would like Voiceover to still be enabled.
So, after spending a to much time trying to figure out what the actual problem was, I started digging into the react native accessibility API. There is surprisingly quite a few options, although, nothing that talks about enabling direct touch, at least from this documentation page:

https://reactnative.dev/docs/accessibility

However, if you type something like "direct touch accessibility react native" into google, you can find this github documentation for react native:

https://github.com/equinor/react-native … ibility.md

in this page, it mentions an attribute that is not mentioned in the other documentation "accessibilityTraits" which does have a property for enabling direct touch. However, I could not get it to work. I am not sure what components become direct touch, and how to get my callback to exicute, but my guess is that everything becomes direct touch including buttons, so that a simple onPress callback should work right? Well no matter what I tried, buttons, clickable text onPress, onPressIn, and even the accessibilityActions atribute for performing actions on a component. None of it worked for me.

Now, when I kept digging, trying to look for examples using accessibleTraits, I was not able to find anything, although I found this page, which says that accessibilityTraits is going to be deprecated soon for accessibilityRole, and accessibilityStates:

http://man.hubwiz.com/docset/React_Nati … ility.html

I am actually not sure how reliable a source this is, I am not sure what hubwiz.com is, although, given that it is not working, I might believe that accessibilityTraits is depercated now, hense why the first documentation page I linked to, which seems the most reliable, did not mention the accessibilityTraits attribute at all.

So, does react native support direct touch in its accessibility API or not? Is there another way of handling this issue I am having?
If not, then I have aditional questions about perhaps dropping down into Swift to implement a View which has direct touch enabled, that I could use in React native. From my understanding from the docs, Expo won't allow me to intigrate native code into react native, I have to first eject the project and "there is no going back" says the docs, and then I have to import into XCode, write up my swift class, and then I can continue on my way with react native, although without expo sigh... So my questions would be how to use react native without expo?

Here is another resource I found, although using objective C, goes over the accessibility API, specifically providing the code to enable direct touch for a view:

https://www.applevis.com/guides/tips-ta … r-your-app

Sorry about the long post, this problem  has been driving me nuts though.

2020-10-14 06:32:30

Hi

Wow, that was a mouthful.
Firstly, you could use the gesture responder system, found in the react native docs, to accomplish direct touch. It may not be the best bet, but it works.
Also, if you're a beginner, I wouldn't suggest ejecting from expo. When you do that, it becomes much harder to manage your own project, especially if you're just starting out in react native.
However, if you already have experience in react native, by all means, go ahead. Ejecting from expo does give you a lot of benefits, including speech to text, and a lot of the components that don't work with expo.

Founder and Managing director of Vidyadrishti.
Check us out on twitter at https://twitter.com/vidya_drishti
Check us out on instagram at https://instagram.com/vd.vidyadrishti
Check my YouTube channel out at https://youtube.com/c/techwithphoenix

2020-10-14 18:44:14

Hi, thank you, I think that the gesture responder should work. I was thinking that react native might have a way around the issue and looked into TouchOpacity, touchables, etc... but I did not find this API page on the gesture responder.

I am new to working with react native, although not new to working with react. That is the main reason why I picked up react native for this project rather than Swift.

Correct me if I am wrong, won't I have to eject the project to get it sideloaded onto a phone eventually anyways? which would mean any additional updates would have to be done without Expo right?

2020-10-14 21:26:20 (edited by TJ.Breitenfeldt 2020-10-14 21:27:53)

Okay, well I tried gesture responder, well... actually I installed a wrapper called gesture handler which had much better docs and examples.
It gave me the fine grane control over taps and gestures, as well as the states. It seems that Voiceover is intercepting the activated state of any component, although the end, cancel states are not, and so you can execute  a callback on those states on direct touch, although it is very sensitive, Understandably so. Those events are not meant for what I want. I am not sure if there is a way around this issue since Voiceover is intercepting that activated state, and forcing its own double tap behavior upon the user to activate.
At #17, have you done this before using gesture responder? Do you have code you could share?
I am guessing that you just have to get into Voiceover and enable direct touch, which allows those activate states through immediately without interception. Which goes back to my previous post about perhaps needing to write a simple little Swift view to enable direct touch for, that I could use in react native and dump my own react components into.

2020-10-16 04:19:47

Hi

I haven't used gesture-responder on IOS.
About @post 18@, no, you do not have to eject from Expo to eject from Expo to sideload it onto your phone.
If you do have an apple dev account, running expo build:ios would get you an ipa file.

Founder and Managing director of Vidyadrishti.
Check us out on twitter at https://twitter.com/vidya_drishti
Check us out on instagram at https://instagram.com/vd.vidyadrishti
Check my YouTube channel out at https://youtube.com/c/techwithphoenix

2020-10-17 20:06:54

At #20, that is good to know.
For anyone else who has any interest in IOS development, I am going to post what I have found out.

It seems that the accessibilityTraits property allowsDirectInteraction is broken, and the documentation is inconsistent. I opened an issue for this on the React Native github repository.
So, in the end, I figured out through a lot of pane how to integrate a Swift View with Direct Touch enabled into my react native project. It is not all that much code in the end, although setting your project up to handle this is not fun. As mentioned before, you cannot bridge native code into react native such as Swift using Expo. So, you must either eject, or just create a new project using the react-native-cli, and copy over your source code. The second is what I did since ejecting looked like it was just going to be harder in the end.

When working with a react native project without Expo, you have to use the native tools, such as XCode to run and deploy onto a IPhone. Learning how to actually use XCode gave me a bit of trouble since it is not exactly intuitive on how to modify project properties, or how to open an editor for a code file. you have to get to the navigator pane, command 1 will do it, select the file you want to open, and then uninteract twice, scroll to the right to select editor, interact with editor, followed by the area that has speaks the name of the file you are opening, and then you can scroll to the right and interact with the scroll pane which is the editor itself. I am sure that there is an easier way to get to the editor, although I found the most frustrating part that I could not just do VO space or command o to open the file. The other thing that drove me nuts for a long time was the error that is given when you try to run your project in XCode something to the affect of "missing developer team". After a lot of Googling, I figured out that I had to modify the project properties, and the properties file had an extention of .xcodeproj. Problem is that when you go to the file navigator, there is no file with an extention of .xcodeprj. It was confusing especially since I am used to Eclipse where to modify project properties, you right clikc and go to the wnative windows property screen. In XCode, you have to select the name of your project, to be clear, you have to first expand your project name once and down arrow to the second iteration of your project name, then uninteract twice and go to the editor. The editor pane does not actually give you a tex editor to manipulate text, it gives you a UI for modifying properties. Selecting the signing tab, and then setting the developer team to your developer accounts signing certificate, you can fix the error. Note that you have to do this twice for both the main project and test targets. There is a button that mentions targets that you have to select which target you are changing properties for.
The short of it is that for every new project you create, you have to make sure that your main project and tests have a developer team assigned to them. These are called targets, and the developer team is the developer account you linked to XCode.

To explain everything I did would take a while, especially since most of my troubles came from installing the native packages for react navigation, which has a tun of dependencies. As long as you follow the react navigation getting started page carefully unlike me, you should be fine.

In terms of running the project, there are a couple things to do. The simulator is not very accessible. Well, to clarify, you can run the simulator, Voiceover will read controls for the virtual IPhone such as volume buttons or home button, but I could never figure out how to actually interact with the screen itself. Either way, the simulator lags pretty bad, and constantly is saying it is busy. so, you can relatively easily just run your app on your phone and even get a similar process as Expo as long as your phone is plugged into your Mac. The first thing you have to do is set the developer teams for your project and tests in XCode. Not sure if this can be done via the command line, probably, although it is not hard to do once you figured it out in XCode. Once that is done, you might be tempted to run your project using command r in XCode, just don't. It is very frustrating to deal with errors since react native has like 400 warnings that are generated, and the issue navigator just becomes unwieldy often causing Voiceover to freeze up. Instead, you will need to open 2 different terminal windows in your project directory.
in the first, run
npm start
to start the metro server, and
in the second, run
react-native run-ios --device "iPhone Timothy"
replace iPhone Timothy with your device name. after you run this command once, you may not need to include the device name.It will build and deploy to the phone. Note that your phone has to be plugged into your computer. When you try to open the app the first time you will get a warning about insecure certificates. To run your app, you have to trust your developer profile by going to settings/general/device management and trusting your profile. You should be able to run your app now, and if there are errors, some might show up on the phone, but most of the time examining both of the terminal windows for errors is more reliable. the window that is running your metro server will throw errors too, not just the window that you used to build the app. I found that some errors just did not show up in XCode,, even though the app may build but nothing would happen. Not sure if there is a way to get to those errors in XCode, but just running everything in the terminal is the easiest in my opinion. When making changes now in your code you should be able to shake your phone once done to open up the debug menu, note that your phone is still plugged in, click reload here, and it will just reload your app on to your phone for you pretty quickly. You can also use watchman, which is a tool for monitoring a folder structure for changes, so that on save, assuming that live reload is enabled in the debug menu on your phone, shake it to open this menu like mentioned, this should update on save of your code now.

Well that was a lot, and I simplified what I did quite a bit. I suppose I see why there is just not a single source of truth on how to get everything setup especially for a screen reader user.

I hope this helps someone.

Timothy Breitenfeldt