Skip to content

Type AppMain does not conform to protocol App #188

Answered by marcprux
davidakoontz asked this question in Q&A
Discussion options

You must be logged in to vote

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 an AppMain shim that looks like:

import SwiftUI
import HelloSkip

/// The entry point to the app simply loads the App implementation from SwiftPM module.
@main struct AppMain: App, HelloSkipApp {
}

This implementation is left empty, because all the logic is defined in a the HelloSkipApp protocol in the HelloSkip SwiftPM module, which will look like this:

public protocol HelloSkipApp : App {
}

/// The entry point to the HelloSkip app.
/// The concrete …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by marcprux
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants