Will there ever be a sample project in Swift that uses Metal?Perhaps released with WWDC 2021?
Metal Sample Code in Swift?
Will there ever be a sample project in Swift that uses Metal?Perhaps released with WWDC 2021?
There are a number of reasons why most of the Metal samples are written in Objective-C and not Swift, probably the most important of which is that most game developers prefer C++ and, although Objective-C is not their ideal choice, Swift is non-starter for them.
That said, we do have a handful of Metal samples written with Swift. This version of the Rendering a Scene with Deferred Lighting is written in Swift (and there are separate downloads for Objective-C and C++ versions). The Supporting Simulator in a Metal App sample has both Swift and Objective-C versions in the same download.
Thanks for the info! I'll be sure to look into that one
The project linked is in Objective-C...
I don't understand why Apple Engineers keep preferring Objective-C for sample code. I presume they think most people are still using it, but at my employer we converted to Swift years ago. Translating things mentally from Obj-C to Swift is now difficult because I haven't used it in years, and Swift is where most of the iOS/MacOS market is today. Back when I worked at Apple in the mid 90's we still had some sample code in Pascal, which made just as much sense, i.e. none.
Maybe things will improve in WWDC 21.
There are a number of reasons why most of the Metal samples are written in Objective-C and not Swift, probably the most important of which is that most game developers prefer C++ and, although Objective-C is not their ideal choice, Swift is non-starter for them.
That said, we do have a handful of Metal samples written with Swift. This version of the Rendering a Scene with Deferred Lighting is written in Swift (and there are separate downloads for Objective-C and C++ versions). The Supporting Simulator in a Metal App sample has both Swift and Objective-C versions in the same download.
Thanks for the info! I'll be sure to look into that one