Simple Counter macOS example #452
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Stuart & Viktor - I have created an example of a MacOS implementation of the Simple Counter example (.examples/simple_counter/macOS). I chatted with Viktor on Zulip and he said to submit a PR. I see an existing issue related to this (Crux with macOS and SwiftUI #248) in case this Closes #248.
I followed your existing docs (latest_master) using the iOS - Swfit and SwifUI - using XcodeGen to build this macOS example. There are only two difference from the iOS instructions:
I have tested using deploymentTargets of 15 (matches existing iOS example) as well as 26 and everything worked fine. One issue I did encounter was that I could not have both the iOS and macOS projects open at the same time in Xcode as they both reference the same shared binary and this would cause a build error for whichever of the two projects was opened second in Xcode. Quitting Xcode and reopening one project at a time resulted in clean builds.