Where to add Swift Views? Sources/ or Darwin/Sources/ or Android/app/src/main/?
#55
|
OK - I'm giving in and asking... I added a Swift View file into the HelloSkip project and tried to compile. It failed.... the Canvas preview message states it cannot compile because the file is not in the scheme... OMG! What does that mean... well the internet thinks it means to restart Xcode. Then I took a closer look at the HelloSkip project - there is yet-another logical place to put a new file... so I moved it... same thing - file not in scheme. How does one add a file to a scheme... I don't know - cann't tell. So looking closer at the project there is YET ANOTHER place to add a Swift file... counting - that 3 places. And I don't remember being told which or any place a new file should be placed in the Getting Started or Docs. Searching... nothing... If you were a developer where would you create a new file: Darwin/Sources/ OR Sources/Skip/ OR App/ each has a certain logic to being the place to put a new file. Then there is the fact that HelloSkipAppMain.swift lives in multiple places...
Where SHOULD I put a new file? |
Replies: 2 comments
|
You should implement everything app-related in the module(s) under the The Documentation on this topic is still forthcoming. Thanks for helping identify this deficiency, and we hope you continue to try out the Skip tech preview! |
|
Thank you Marc, I'm still playing with Skip and porting my InspireMe! Cards App. Should be an easy translation as it is a very simple Card Deck app. I appreciate your time & effort. I'm excited about this tool - and the future of it! |
You should implement everything app-related in the module(s) under the
Sources/AppName/. Source code in theDarwin/Sources/andAndroid/app/src/main/folders are the app's Swift/Kotlin outermost "scaffolding" and are not transpiled by Skip, and will generally contain the nitty-gritty details of the deployment for the app on each platforms.The
Sources/AppName/folder (and any other local or remote dependent modules you add to yourPackage.swiftproject) will be transpiled into Kotlin, and so run on both platforms. That is where you should do your app and model development. You generally only need to touch the platform-specific stuff when you have very platform-bespoke setup to perform, li…