Getting started with programming on Mac and/or iOS.

By Khomus, 1 November, 2024

Forum
macOS and Mac Apps

Hi all.

Any good resources for getting started programming for the Mac or iOS? I think I'm more interested in Mac right now, but I figured they should be close enough anyway that it makes sense just to ask about both. I've done some programming before, but never on a modern GUI. So all command line stuff, no having to make windows and all that good stuff.

I know a bit of Python, but I also think whatever mac typically programs in probably has all the accessibility stuff built-in already, so I'd probably want to start there. I'm pretty sure I need to get ZCode, and there's something about Swift and accessibility,, and that exhausts my knowledge of any kind of programming on Mac.

I know at least the programming basics, i.e. variables, loops, arrays, and so on. But I'm not going to be offended if you offer a resource that starts at the very beginning, because this will all be so new to me that I'll have to start there anyway, in terms of the programs I'm writing to learn.

I should add that I've programmed in a fair number of languages, Pascal, C, C++, Python, LISP (gods forbid that ever happen again), maybe a few others. But like I said, modern programming will be all new. And obviously I'd want my programs to be accessible, in case we have something with that focus.

So I'd say even though I just said I've programmed in some languages already, just assume I'm a total newbie. I just offered that up to say that the ideas of programming aren't going to overwhelm me. But otherwise, no idea what you do to program for Mac or how ZCode works or if I need to get an IDE on top of that, and so on and so on and so on.

I did search Bookshare for books on the Mac and didn't see a lot, but maybe I didn't put in a good search to turn up any programming resources they have. Otherwise web is great,but if there are accessible e-books, I'll pay for those no problem.

Options

Comments

By João Santos on Monday, November 4, 2024 - 17:54

Xcode is Apple's official Integrated Development Environment, and you are absolutely required to install it for any kind of native development even if you don't intend to use it, because it contains the Software Development Kits required to build for Apple's platforms. Walled garden platforms, like iOS, TVOS, WatchOS, and VisionOS also require Xcode for on-device testing and public distribution.

Swift is a modern and safe open-source cross-platform application development language that Apple created to almost completely replace Objective-C, which is the native language of the overwhelming majority of Apple's frameworks. There are cases in which swift isn't a good choice, but in my experience this only happens when you interact with lower level frameworks like Metal, CoreAudio, or CoreMIDI. SwiftUI is a swift-only declarative framework that draws inspiration from the flexible box layout descriptions in Cascading Stylesheets on the web. that makes it very easy to design user interfaces with code. There are some cases that still require embedding AppKit (MacOS) or UIKit (iOS) widgets, because sometimes SwiftUI is either not versatile enough or is completely missing specific widgets, but the simplicity of describing layouts with SwiftUI is unbeatable.

As for resources, you should check out Swift's official documentation, Apple's SwiftUI tutorials, and Paul Hudson's Hacking With Swift website. Xcode might feel a little complicated to use in the beginning, especially if you've never actually experienced its user interface visually, but it's a lot more accessible than it was 10 years ago when I lost my sight. I did find a tutorial on how to use Xcode here on AppleVis, but am not linking to it since it's extremely outdated.

There's also an app made by Apple for Mac and iPad called Swift Playgrounds designed to teach everything from programming fundamentals all the way to building and publishing actual applications to the App Store even from an iPad, which is something that I usually recommend to sighted beginners. I did test the app on the Mac and found it to be borderline inaccessible., but couldn't be bothered to try it on iPad.

There's also a cross-platform C++ library called WxWidgets that appears to be accessible, and has bindings for some scripting languages like Python and Perl, so depending on your use case, that library might offer the path of least resistance.

Finally, if you have a Mac desktop, have absolutely no sight, and intend to develop for MacOS, I strongly recommend getting the Magic Trackpad and learning to use VoiceOver's Trackpad Commander, which is useful to navigate by dragging your finger on the trackpad to verify the visual layout just like on a device with a touch-screen.

PS: Since I'm not providing resources on how to use Xcode without any sight, I will be subscribing to this thread to answer follow up questions about that.

By PaulMartz on Monday, November 4, 2024 - 17:54

I tried to learn Swift some years back. One huge hurdle is that the language changes dramatically between versions, and all the online programming forums discussing the outdated versions persist forever. I would do a web search for switch case syntax, write my code, and find it wouldn’t compile because the syntax had changed. There’s a compiler option to select the version, but that’s no help unless you want to rewrite the code that’s already compiling with the latest version. I hope you have better luck with it than I did.

When installing Xcode, look for an option to include command line tools. If you’re already used to gcc etcetera, that might be a good place for you to start.

From 2005 to when I retired in 2015, I developed cross-platform linux, Windows, and MacOS using a tool called CMake. Basically, you create CMake configuration files outlining dependencies at a high level, then CMake generates the build environment files of your choice, which might be make makefiles, Visual Studio project files, Xcode project files, or whatever build environment files you want, including many I’ve never heard of. But the result is that I was able to create software projects that could be built on any platform. Not sure that’s a concern for you, but I thought I’d throw it out there.

By PaulMartz on Monday, November 4, 2024 - 17:54

This topic comes up a lot on AppleVis. You might want to search the site for similar topics. You'll find good information there.