Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new samples #511

Merged
merged 13 commits into from
Jun 25, 2024
Merged

Add new samples #511

merged 13 commits into from
Jun 25, 2024

Conversation

bamx23
Copy link
Collaborator

@bamx23 bamx23 commented Jun 22, 2024

This PR adds a minimal sample for each of the supported platforms.

Supporting Xcode projects for each of the platform is a bit painful, so here I'm adding a dependency on Tuist for projects generation.
The common part of the samples is managed using SPM to ensure that integration of KSCrash into samples is as close as possible to real use of SPM. Sorry, no CocoaPods (not sorry).

As a follow up, we can create a set of build jobs to ensure there's no breaking API changes (after most of the APIs are used in these samples).

Base automatically changed from clean-up-project to master June 22, 2024 21:59
@bamx23 bamx23 marked this pull request as ready for review June 23, 2024 11:16
Copy link
Collaborator

@GLinnik21 GLinnik21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I thought that we can use one SwiftUI code for all the platforms without separate subfolders and configurations. If it's not applicable to Tuist, maybe one xcproject is not a bad solution?

Samples/Common/Package.swift Outdated Show resolved Hide resolved

public class RecordingSample {
public static func simpleInstall() {
let config = KSCrashConfiguration()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think? Does this name look ok in swift?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. I would want to have just install if I don't care about config.

And also maybe having a way to inline config creation like:

KSCrash.shared().install(with: .init(monitors: [.asyncSafe]))

But this last idea is the one I'm not sure about here.

Samples/Common/Sources/SampleUI/SampleView.swift Outdated Show resolved Hide resolved
@bamx23
Copy link
Collaborator Author

bamx23 commented Jun 23, 2024

Actually I thought that we can use one SwiftUI code for all the platforms without separate subfolders and configurations. If it's not applicable to Tuist, maybe one xcproject is not a bad solution?

While I think it can be possible, I would still have this entry point file to be separate for each of the samples. The most of the code is intended to go to that common SwiftUI library. But it's already not the same for macOS as we need to override the app delegate. 2 files per sample that you don't need to touch in most of the cases – sounds good to me.

@GLinnik21 GLinnik21 merged commit 3a3b99e into master Jun 25, 2024
5 checks passed
@GLinnik21 GLinnik21 deleted the add-samples branch June 25, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants