Export Idea - Swift Playgrounds 4

I wonder if there is someway to export a Codea project as a Apple Swift Playgrounds 4 app. You could then upload your app directly from your iOS device to the App Store without a Mac. Anyway just thinking out loud…

@krdavis - I thought you still needed Xcode to convert Swift to a standalone app?

@Bri_G - Nope, Playgrounds 4 let’s you build and submit apps directly to the App Store without the use of XCode.

i don’t think it would be possible since codea and playgrounds use different languages and different foundational packages underneath, the export would have to absolute transpile all the project code and things like Mesh/Craft would need mapping to different solutions or whole new support files would be needed to be added

There maybe other issues, but the language part doesn’t make sense to me as the XCode export includes Swift, Lua, and Obj-C. Anyway it would be nice not to have to relay on XCode and a Mac to get Codea apps on the store. Playgrounds 4 now let’s you bypass XCode and let’s you submit from your mobile device directly to the App Store. Maybe Apple comes out on top here with their new playground version… IDK

Facebook or Meta now was working on this transcoder ai that translates code across languages. Not sure how far they are now. But in the future it might allow for easier porting.

I’d be a lot more likely to port things to swift than Xcode, but that’s just me. You’d need a Lua interpreter of course, but I suspect the existing one could link in? Maybe.

I looked into this a bit further and it looks like one would need a Lua interpreter written in Swift as the new Playgrounds app doesn’t support Obj-C on iOS. I can’t find one, so maybe this would be more work than it’s worth. Hmmmm…

I’m going off of memory here, but I think @skar is right. Swift Playgrounds only supports SwiftUI for building apps. Codea, however, is built on top of OpenGL ES (as far as I know). Thus it would be necessary to recreate Codea’s drawing operations in SwiftUI, which I don’t know is possible and probably means worse performance. Hopefully, they either extend the functionality of Swift Playgrounds or bring the full Xcode to iPad.

If Swift Playgrounds 4 can link binary frameworks then it might be possible to export a compatible project

@Elias - UIKit is also supported, I’ve used it to create particle emitters in Plagrounds.

@krdavis You’re right, I’m probably misremembering the presentation they did a couple months ago. I thought only specific apps could be uploaded and that they use a specific file format. But reading through the update-description in the AppStore again, it sounds as if all apps you make in Swift Playgrounds can be uploaded.

@Simeon Sounds great!