Type AppMain does not conform to protocol App #188
-
I'm a bit wrapped up and bound by all this... stuff beyond the capabilities of a simple cave man. The error on my Skip AppMain is Error 1: Inheritance from non-protocol type 'PainlessPasswordApp' The file: PainlessPasswordAppMain.swift ` /// The entry point to the app simply loads the App implementation from SPM module. Any clue to resolve this - I've been deleting Build Folder & DerivedData folder... Any other ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I started over - back at the beginning... and had to remove some of the changes I'd made... Logging the BONEHEAD idea here... `#if !SKIP /// The entry point to the PainlessPassword app.
} |
Beta Was this translation helpful? Give feedback.
-
Yes, you'll want to keep that protocol implementation. All the code that is transpiled in Skip is done in a SwiftPM module, but since Xcode requires at least one top-level target (that isn't a SwiftPM module), our
This implementation is left empty, because all the logic is defined in a the
This allows you to define your app logic in the SwiftPM module in a way that can be shared with the Android side. The short answer, though, is that it is probably best not to mess around with the auto-generated app scaffolding, and concentrate more on staying within the guidelines for the best experience. |
Beta Was this translation helpful? Give feedback.
-
Right - good advice - stay within the guides! I'm still pondering how the Android App is launched... but for now just happy I can inject my AppState ObservedObject into the Env. and it works over on the Kotlin side also! |
Beta Was this translation helpful? Give feedback.
Yes, you'll want to keep that protocol implementation. All the code that is transpiled in Skip is done in a SwiftPM module, but since Xcode requires at least one top-level target (that isn't a SwiftPM module), our
skip init
command creates anAppMain
shim that looks like:This implementation is left empty, because all the logic is defined in a the
HelloSkipApp
protocol in theHelloSkip
SwiftPM module, which will look like this: