Alamofire (afaik) essentially offers HTTP caching and also supports cache headers, etc.
Oct 30, 2020, 4:15 PM
Alamofire (afaik) essentially offers HTTP caching and also supports cache headers, etc. I find that it’s difficult to work with these limitations so always implement the cache layer on top of the networking layer.Luckily, you can really...
I just wrote it in SwiftUI.
May 2, 2020, 1:57 PM
I just wrote it in SwiftUI. I have a ModalManager which has an optional modal property. Then, I wrap all the base view like this: ZStack(alignment: .bottom) { content ZStack(alignment: .bottom) { if...
It depends a lot on the app.
Jan 29, 2020, 11:31 PM
It depends a lot on the app. If your app contains a feed or search, you can end up fetching a lot of data even if it doesn’t contain assets. But, this of course depends on your data structure and use case, so yes, if you expect to never...
Thanks a lot! Fixed it. :)
Dec 20, 2019, 8:16 PM
Thanks a lot! Fixed it. :)
All you never wanted to know about state in SwiftUI
Dec 9, 2019, 10:29 AM
I recently released an app written 100% in SwiftUI and in doing so, uncovered some patterns that are difficult to express. In this post, I am going to explain how to set initial state in SwiftUI. It’s trickier than you’d expect.First,...
I’m on better internet (finally), so will go ahead and update the article and codebase.
Aug 29, 2019, 10:02 AM
I’m on better internet (finally), so will go ahead and update the article and codebase. Avoiding using the same `Network` object isn’t a great solution because it creates a new `URLSession` for each request. I can’t remember the details,...
Thanks. This is great advice.
Aug 22, 2019, 12:38 PM
Thanks. This is great advice. For simplicity (and the assumption that people won’t be making that many network requests), I’m going to leave the article as is for now (maybe I’ll update it when I get some more time later), but I’ve linked...
Are you referring to the use of a singleton?
Aug 22, 2019, 12:36 PM
Are you referring to the use of a singleton? If so, take a look at my responses to previous comments and let me know what you think:True, but hopefully you can hide as much as you can from the API.Good question. Kay Butter had the same...
Good question. Kay Butter had the same question. Here was my response:
Aug 19, 2019, 3:54 AM
Good question. Kay Butter had the same question. Here was my response:I’ve always found for this case a singleton is ok because you actually only ever have one network stack, though dependency injection can be a bit trickier.In your apps,...
Personally, I think the api is terse and understandable, but also extensible.
Aug 17, 2019, 3:06 AM
Personally, I think the api is terse and understandable, but also extensible. It’s super easy to send a request and get a model back, but with using protocols, it’s also easy to add support for different requests and types.
True, but hopefully you can hide as much as you can from the API.
Aug 17, 2019, 3:04 AM
True, but hopefully you can hide as much as you can from the API. Of course, all code will grow and grow. 😅Interesting point on the singletons. Do you pass around a network stack as a parameter to view controllers? Or how do you manage it...