StanfordSpezi / SpeziTemplateApplication

Template application demonstrating the usage of the Stanford Spezi framework.
https://stanfordspezi.github.io/SpeziTemplateApplication
MIT License
97 stars 19 forks source link

Use the new #Preview macro #44

Closed NikolaiMadlener closed 10 months ago

NikolaiMadlener commented 10 months ago

Use the new #Preview macro

:recycle: Current situation & Problem

As partially described in #23, currently all previews of views are written the old way using the PreviewProvider protocol. The new #Preview macro, introduced with iOS 17, should be used in every view instead.

:gear: Release Notes

:books: Documentation

:white_check_mark: Testing

:pencil: Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

NikolaiMadlener commented 10 months ago

Just a very small update to take advantage of the new #Previews macro as I've been working on the TemplateApplication these days anyway.

Also, #23 mentions that some views in the app crash or are non-existent. I found all previews working fine while updating to the macro, so I guess that information is outdated @PSchmiedmayer?

I'm also thinking about a solution for https://github.com/StanfordSpezi/Spezi/issues/63 atm.

codecov[bot] commented 10 months ago

Codecov Report

Merging #44 (3a56947) into main (e88698d) will increase coverage by 1.00%. The diff coverage is 83.34%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44/graphs/tree.svg?width=650&height=150&src=pr&token=6EPKiz2l15&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi)](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) ```diff @@ Coverage Diff @@ ## main #44 +/- ## ========================================== + Coverage 81.59% 82.58% +1.00% ========================================== Files 35 35 Lines 999 987 -12 ========================================== Hits 815 815 + Misses 184 172 -12 ``` | [Files](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) | Coverage Δ | | |---|---|---| | [TemplateApplication/Account/AccountButton.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9BY2NvdW50L0FjY291bnRCdXR0b24uc3dpZnQ=) | `100.00% <100.00%> (ø)` | | | [...mplateApplication/Account/AccountSetupHeader.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9BY2NvdW50L0FjY291bnRTZXR1cEhlYWRlci5zd2lmdA==) | `100.00% <ø> (ø)` | | | [TemplateApplication/Account/AccountSheet.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9BY2NvdW50L0FjY291bnRTaGVldC5zd2lmdA==) | `97.83% <ø> (+12.93%)` | :arrow_up: | | [...eApplication/Contributions/ContributionsList.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9Db250cmlidXRpb25zL0NvbnRyaWJ1dGlvbnNMaXN0LnN3aWZ0) | `100.00% <ø> (ø)` | | | [...emplateApplication/Contributions/PackageCell.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9Db250cmlidXRpb25zL1BhY2thZ2VDZWxsLnN3aWZ0) | `86.49% <ø> (ø)` | | | [TemplateApplication/Home.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9Ib21lLnN3aWZ0) | `100.00% <ø> (ø)` | | | [TemplateApplication/MockUpload/MockUpload.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9Nb2NrVXBsb2FkL01vY2tVcGxvYWQuc3dpZnQ=) | `92.31% <ø> (ø)` | | | [...lateApplication/Onboarding/AccountOnboarding.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9PbmJvYXJkaW5nL0FjY291bnRPbmJvYXJkaW5nLnN3aWZ0) | `88.89% <ø> (ø)` | | | [TemplateApplication/Onboarding/Consent.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9PbmJvYXJkaW5nL0NvbnNlbnQuc3dpZnQ=) | `94.12% <ø> (ø)` | | | [...eApplication/Onboarding/HealthKitPermissions.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-VGVtcGxhdGVBcHBsaWNhdGlvbi9PbmJvYXJkaW5nL0hlYWx0aEtpdFBlcm1pc3Npb25zLnN3aWZ0) | `95.56% <ø> (ø)` | | | ... and [8 more](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Last update [e88698d...3a56947](https://app.codecov.io/gh/StanfordSpezi/SpeziTemplateApplication/pull/44?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi).