steamclock / netable

A Swift library for encapsulating network APIs using Codable in a type-oriented way.
MIT License
99 stars 3 forks source link

SwiftUI Example Project #105

Closed amyoulton closed 1 year ago

amyoulton commented 1 year ago

This is an ongoing draft PR for collaboration/feedback as we continue to build out the project

The new example project is being built out with SwiftUI. I have set the project settings and built out a mock "API" using Swifter.

I originally wanted to included live previews within the application, but because the network is being run within the application, if you have a build open, the live preview throws a fatal error because a port is already open. That's the nature of the network being within the app. Since it's a super fast app to build, so I've chosen to keep live previews off.

The Project

Currently, I've added the following things into the new SwiftUI project:

The "API"

This includes my JSON data that I will continue to add to, and my network that leverages Swifter. I have currently added JSON data for:

I'll update the above list as the project continues getting built out, as more JSON will be added.

The Build

brendanlensink commented 1 year ago

Another thing I forgot to mention: We should go through the app with concurrency checking set to Complete and try and sort out any warnings it's throwing. Even with minimal it's throwing >10 😬

amyoulton commented 1 year ago

@brendanlensink Woo! Tons of changes & updates made. 🔥

Here are the significant ones I can think of to report on:

I did some other small tidies but they've escaped me 😅

amyoulton commented 1 year ago

@brendanlensink looking through this PR again after the break apparently let my eyeballs actually work because I seemed to entirely ignore that concurrency checking comment.

I have some questions I've left on your above comments!

So I will need to do that as well and then re-submit, which will I believe will warrant a re-review. Thoughts?

amyoulton commented 1 year ago

@brendanlensink alright, this should be final review 🥳 I've added the changes, removed the example project and updated the links. I have not added in Sendable conformance though, because this is turning out to be a lot more of a headache than expected.

Since for the most part, conforming to Sendable will happen outside of my project, I was thinking that once this is merged, I'll rebase #115 and conform to Sendable for Netable on that issue, while also adding the few conformances to the example project at the same time, since they will be so interwoven, and the example project does a great job of really showing where the conformance issues lie!

Let me know your thoughts on this, but either way I believe we should merge this first!