Swift: How to start coding?

Hi,

I was able to download XCode, create a brand new Swift project (I hope), now I am in the well and do not know where to put code / how to start coding.

Any hint ?
TIA

PS: I hope a Windows version by Apple to be released (ANN ?) tomorrow.

Not sure how to answer your question… there are different variations of how a Swift program can be created…

  • Using Interface Builder for your GUI (good luck with that)… this can apply to both macOS or iOS projects
  • Create using the new SwiftUI (which I haven’t explored yet myself)
  • Do it 100% in code (including the UI)

I doubt seriously if Apple is going to announce a Windows version of Swift, tommorow or ever. There are several open source Swift implementaions for Windows, but they are either missing or severly lacking in the GUI department.

Look elsewhere on this forum and you will find a dozen or more topics where I posted Swift code libraries to emulate some of the Xojo syntax you are already familiar with

Thanks Dave for your answer.

For a Windows Swift version from Apple:
I am sure to read something (ANN) about that from Apple. But now, if you do not know, maybe it was in a dream…

Only 9 hours to wait for today WWDC intro.

SwiftUI is the future for development on Apple platforms - expect huge moves forward on this today/week. Invest your time here.

Is there any way to try this on Mojave? It seems MacOS applications can’t be made without Xcode 11.5 or greater, even though iOS apps can…

I am using XCode 11.3.1 and Mojave and writing Swift code that runs in Mojave … there has been no restriction since Swift 1.0 as far as I know.

Personally I have not invested any time into SwiftUI and haven’t found any examples or articles that really indicate what its about. I’ve been playing with Swift since 1.0 (now at 5.1)

I find the following table quite useful: https://en.wikipedia.org/wiki/Xcode#11.x_series

I’m surprised you’re not using it. I can’t stand the old way of creating UIs. SwiftUI is a very forward thinking way of doing things.
I feel this is where .NET needs to go. They have “create UI in Code” (using XAML) but the drag/drop tools are not available or not up to the level of what SwiftUI seems to be doing.

I wish I could figure out why I can’t use SwiftUI for MacOS desktop apps under Mojave. Nothing in the literature says that I can’t. I mean, it allows it, it just uses commands that it errors out on. Kinda weird.

Perhaps no support for it built into that version of Xcode ?
Xcode is built out of LOTS of components so its possible there isnt one for swiftUI

Yeah, can’t find any docs.
Making it hard to not update. Hopefully soon manufacturers will update their software (or more likely I find alternatives) so I can update to Catalina…