Gauging interest in Swift tutorials for Xojo programmers

Would IfNotNil members be interested in tutorials about Swift, with a focus on comparing Swift to Xojo? It would also cover SwiftUI to build UIs and Xcode (just a bit, to compare and contrast it with the Xojo IDE and show how to get started with it). When possible, Swift code snippets to perform the equivalent of common Xojo tasks will be discussed as needed. Yes, there are lots of Swift and SwiftUI tutorials on the Web, but I’d discuss it all with a Xojo perspective. The series will be fairly simple at first, then introduce more complexity only when necessary.

This would be a big undertaking, but if there’s enough interest I’ll give it a try. I just don’t want to undertake all of this effort for only one or two readers.

The biggest caveat is my health. I can’t predict if and when I’ll get enough “good” days to work on this project. Case in point: Just over the past 2 weeks, it’s been a “delight” having roofers replace the roofs of our building and neighboring buildings. The noise has had me cringing in a dark room with industrial noise-blocking headphones because the migraines have been brutal. But they have to finish soon, and I’m hoping that I’ll have the chance to get my head back into shape enough to start coding again. Still, there will likely be brief periods of slow updates from me as I weather more daily migraine attacks. If readers can accept delays while I recover from attacks, I’d sure like to do this. I could use a project to keep me occupied.

Please let me know if you’re interested, and what you’d especially like to see covered.

YES.

I’ve been using Xojo since version 2.something and I really like the language. But I’ve been arguing with myself for two years now wether I should update or not (I’m still using 2017), but with what I’m reading on this forum, and with the tests I did with various demo version, I simply can’t justify the cost. There may come a time when Xojo gets their a**** around and deliver a decent product again.

But for now it’s time to look for greener pastures, I think. (Xojo is one of the reasons why I’m still on macOS Mojave!) What kept me from switching to Swift so far is not the language itself, but 1) Xcode and 2) the behemoth that is the macOS/iOS APIs. Especially the fact that there often are classes for the “same” thing in NS…, CG…, CF…

So my first interest would be in how to set up a new Project in Xcode, and then how to replicate the ease of use of Xojo (within reason, of course). I’m sure you know @DaveS already started a nice tutorial Swift for Xojo Developers, but there weren’t updates for some months now (I guess because of lack of responses).

So yes, I’d be very interested in your tutorial, and delays won’t bother me. I don’t make an income with programming, and everything I’ll learn from you will be for my personal benefit :wink:

I hope the roofers get their work done quickly. Get well soon, and stay healthy!

1 Like

I’d agree with everything you said here

Getting started is usually the first hurdle

Using the MBS plugins basically requires you to get into Swift as all the answers to your questions are on the Apple forums and written in - you guessed it - Swift.

I think what is needed is less a traditional tutorial but more what Matt Neuburg would write: information on how it works and how it differs from Xojo. An example is that parameters types are usually explicitly named, but CAN be omitted by using underscore. As a newbie coming from Xojo you see an underscore in code that is supposed to be your answer and go :flushed: :scream: :exploding_head:

I thought about writing a Swift primer for xDev myself, but in any case a big YES from me …

Like all instruction books, Ive tried.
Pages 1…12 ‘this is dead easy. One plus one is two, Hello world’

page 13:
Now, lets subclass this callback function with a name that is 40 letters long, remembering to create an instance of some obscure library and oh - we have to call that in a different way because its Wednesday, and make a small nuclear power station.
Oh, and by the way, this is just Swift. Swift is the ‘easy bit’
If you want to put a button on a screen in iOS, take a seat, you’re gonna age a few years in a moment.

2 Likes

Yes, please! I am very interested.

It just so happened that i fired up Xcode on my M1 this week and i was shocked how fast i had a simple iOS app up and running on my iPhone.
I remember my first attempt with Xojo took hours until i could finally see something working on my Phone.

My biggest hurdle is not Swift, it’s the Xcode IDE. It’s so much different to the Xojo IDE, i was completely lost. Had to check a few YT Videos before i was able to Build (oops, Profile) my first app. :wink:

I would use Chapters instead of pages. And there are chapters about variables, constants, etc.

So, if I buy some books, I can trash 1/3 of all books (except 1 or all and I read the provided Language Reference).

Yes, I would be very interested.

As I mentioned in a previous thread on this topic i would be most interested in Swift programming centered on Mac OS development.

I have begun some development in Xcode/Swift and really like the language. What I would find extremely helpful are tutorials that focus on the Cocoa and Foundation frameworks, in addition to basic Swift language features.

Thanks for considering this undertaking.

Here are my initial thoughts about the content and structure of the tutorials. I’d love some feedback on these plans before I flesh them out and start coding and writing.

  1. Xcode vs. the Xojo IDE

Start with a gentle comparison of the Xcode and Xojo IDEs, including what you can and can’t do in Xcode relative to what you can and can’t do in the Xojo IDE, and equivalent actions in each. This will cover the most-used features and commands, and the ones needed to start using Xcode.

  1. Swift Playgrounds vs. the Xojo IDE

Introduction to Swift Playgrounds as a way to experiment with Swift language features or user interface controls as they’re being learned, or to prototype an app quickly.

3.Swift vs. Xojo

Comparison of the Swift and Xojo languages: features, design considerations, etc. The most commonly used features will be covered in most detail, while more esoteric topics (e.g., generics, etc.) will be deferred until specifically needed or requested by users.

  1. SwiftUI (If SwiftUI is to be used)

Discussion of SwiftUI’s design philosophy, the use of one SwiftUI control name across all devices, the different views that are included vs. not present yet (as compared to Xojo’s controls), etc. Comparison of building UIs in SwiftUI vs. the Xojo IDE. It might also be compared to UI development in AppKit alone if people want to see that.

By the way, a new Canvas SwiftUI control was just introduced that is similar to the Xojo Canvas in that it draws using similar graphics commands (move, draw, and so on with lines, shapes, etc).

  1. Full Simple App

A simple app will be built from scratch in both Swift and Xojo for discussion. Readers might suggest what the program might do, so long as it doesn’t require adding a bunch of frameworks that would need to be discussed in detail.

  1. More Complex Apps

More and more complex apps might then be discussed to show how to do specific tasks in Swift and Cocoa for the Mac. This will depend upon how much knowledge I have of these specific tasks and the frameworks that support them. Most of my knowledge deals with graphics and scientific computing, so other topics such as networking, audio, or MapKit, would require me to study them in detail first. (Of course, I’d also accept help from others on this!)

All of this would translate into quite a lengthy tutorial series, so feedback is critical before I go any further and start coding and writing.

———-

Here’s the most important feedback that I need immediately: Some IfNotNil users have indicated that they definitely want a Mac-oriented tutorial rather than an iOS-oriented one. This has a major influence on how the code for the tutorials is written and how detailed the discussion must be, so we need to consider the approach taken from the start:

a. Do the tutorials entirely with AppKit for macOS. The down side is that the entire tutorial series would need to be redone (except for most of the Xcode and all of the Swift language discussions) if iOS, iPadOS or watchOS tutorials are needed later.

b. Do the tutorials with SwiftUI for the user interface, reducing the amount of AppKit coverage and its detail until specific needs arise.

c. Do the tutorials entirely in Catalyst, removing the need for separate Mac ands iOS versions. One version of the code can be used for both iPadOS and macOS. Of course, for some platform-specific features such as menus and differences in the general Human Interface Guidelines for each device, tweaking would have to be done to make sure the finished app looks and behaves correctly on each platform — as if it’s native to each device — much like the tweaking Xojo apps may need to feel native on each platform.

d. Combine SwiftUI and Catalyst to reduce the platform-specific code even more.

My preference is to try SwiftUI and Catalyst, but I need to know what your needs are, and what you think would benefit you the most. Thanks!

Scott

a) don’t limit to macOS. it is possible to use one code base for both macOS and iOS , thus being able to show the commonality and differences in the same place

b) SwiftUI has its place, but I don’t think so if you are going to try and show desktop vs mobile, not to mention the fact the gaining knowledge of AppKit (Cocoa) vs UIKit would be advantageous

c) this too detracts from learning the entire envirnoment , and limits the overall knowledge base

d) see B and C

These of course are my opinions, take them as such…

Any knowledge or insight that I may have acquired is at you service.

My only concern here is the magnitude of this task. Doing the entire series for both macOS and iOS/iPadOS would be daunting — it would greatly increase the amount of coding needed and its explanation due to the differences between AppKit and UIKit. It would also keep the discussion constantly jumping between frameworks and devices. There’s already going to be a lot of jumping between Swift and Xojo, and I don’t want to lose the reader’s attention span.

I was hoping to streamline the task by paring down what had to be discussed to allow a more focused set of tutorials. I thought that SwiftUI (and maybe Catalyst) might provide a way of doing that. Besides, it looks like SwiftUI is the way of the future for Apple. I think that once they’ve exposed all of the methods in all controls, and keep optimizing its performance, they’ll expect developers to use it. More and more of Apple’s own software is including SwiftUI now. And they’re also using refining Catalyst and using it more and more for macOS software (yes, the initial Catalyst apps were awful, but they’ve improved).

If you have any other ideas about how to keep this project from becoming too big to finish, I’d love to hear them. I’m fresh out of ideas about that.

I think this plan sounds like a good way to go

I’m really interested in this. :slight_smile: Thank you all.

One suggestion. Create a wiki and include links to each section. That way sections can be added and updated. Sections can help turn the overwhelming into discrete.

I think that creating a wiki is beyond my meager HTML/CSS skills on my small web site. All the web site contains now is my (Sparsely updated) blog and a gallery of my wife’s textbook illustrations. I have no idea how to set up a wiki with the tool I used to create the site (an old version of Flux). If you can point me to some tools for creating a wiki, I’ll investigate it further. Otherwise, I think I’ll have to resort to posts on this web site like Norman and Dave have done. If I can set up links between them, it might serve the purpose of cross-referencing material.

you certainly can link between different posts
if you need assistance ping me

Thanks. Help is always appreciated.

By the way, I know it’s been many years since I’ve seen you in person, but I really don’t remember you looking like the picture in your avatar…

Amazing what age can do :stuck_out_tongue:

That sounds like a good plan. Personally my interest is 1st macOS and 2nd iOS. So I’d prefer tutorials that cover both platforms, maybe leaning a bit towards macOS. I understand that it’s not possible to cover both platforms to their fullest, but hey, I’m a Xojo user. I’m used to have a nice foundation and then have to work around the missing pieces… :stuck_out_tongue:

I would be interested

these tutorials were based on code I wrote for iOS, but a huge amount is non-GUI oriented so it will work with little or no changes on macOS as well