Fun times this week. Workshop hardware trouble, kids with illness, and Swift Heroes announced their first speakers on their line-up.
Lead Software Developer
Learn best practices for being a great lead software developer.
Please rate me on Apple Podcasts.
Hi, and welcome to the 72nd episode of my podcast. My name is Joe Linus and I've been developing software for over 90 years developing iOS apps for over nine years and running such coke ads for over eight years. If you're an iOS app developer, you should listen to a podcast because it will keep you updated interesting articles, conferences and events you might not have heard about. In this episode, I'm going to talk about how to use async await in synchronous Swift code with tasks using the Location button in Swift UI for one time location access. State restoration is swift UI, mixing Swift, Objective C Swift package manager and static frameworks, improved type safety with Swift jet. So it's been an interesting week for me. It started to break I did try swift workshop. And the workshop went well, I think, even though it had some major technical issues. But these technical issues I was able to overcome with some smart thinking. And fortunately, we had like a good code labs that people could work on. While I was straightening out the issues I had with my laptop. biggest issue was the CPU getting saturated, even though I have a MacBook, 13 inch with an M one chip in it. But running zoom X codes and green screening at the same time doesn't really work. Well, it seems. So in the end, I was able to get the workshop going and people really enjoyed themselves. But next time, I'm definitely gonna try out my workshop in the full setup with all the software running. Because I did my initial trial runs without running soon. On all it was a bit challenging, but it did work out in the end. So next to that my my son got chickenpox on Friday, which was kind of interesting, because he didn't have that children's illness yet. So it was all each. And then like, a day later, my daughter started having chickenpox. So it was a really interesting weekend that we had as a family. So two kids that were ill to get that were really itchy. And two kids that were totally unhappy because they just weren't feeling very well. My daughter is still at home, my son is back to school again on Monday. But for my daughter, it's I hope that she recovers quickly because she's still running quite high temperature. And then there's a third topic that happened last week, Swift heroes announced their lineup for their conference, and I'm one of the speakers at this lineup. And if you've seen this initial lineup, one thing that was immediately clear is that I forgot to check the diversity of the lineup. Because once I opened the page, it was just 14 white dudes staring back at me, which isn't really good picture. So I went internal with that was a stream and had a lot of back and forth with other community members. And in the end, several people wrote into the organizers of Swift arrows. And it seems they've got the message. And that's really working on fixing their lineup and making sure that this doesn't happen again in the future. And it's just, it just goes to show how hard it is to do a conference because there's so many details. And this is one of those things, if you just don't stop and think about the lineup and the way it looks, then this is something that you would put live, even though that all the individual speakers on the lineup, I think are great. It's always good to have a look at your lineup as a conference and just see what kind of picture you're representing to the world. And it was very clear that stripped heroes did not take this step when they were putting together their lineup. But I'm told they're fixing things. And hopefully we'll get some new faces on their lineup soon. On top of that, we also had the new Mac hardware announcements. It's interesting what Apple has announced, I'm not going to go too much into technical details of everything that they launched, the biggest question that I had answered myself, which was easy for me is, am I going to be buying any of this new hardware? No, I don't think so. Because my desk setup right now is pretty much complete. I have a 27 inch LG screen in front of me. And I have an MacBook and one pro available. So that's the 13 inch model. And yeah, the performance of that thing is more than enough for me, at least in most cases, not when I'm running zoom Xcode and green screen at the same time. For some reason that wasn't working too well for me. But looking at this new studio display in this MAC studio device. I really like the way that this new display is looking all the ports that are on it not sure if it's enough ports for my use case, but also the the number of ports on it, the features that the screen has. So it's a nice big screen, a decent panel in there. A webcam, good audio at least as good as audio you can have on the screen. So I think if you would get a cheaper option and start adding all those together to get like a similar quality experience. I don't think that the prices differ that many. And the advantage of the studio display is that everything is combined into one device. So there's a lot of cable clutter that you won't be having on your desk when using this screen. So yeah, if I would have like a completely empty desk, then yeah, I would very much like to look into a studio display as an option. But yeah, not for me right now. On the on the Mac Studio. Yeah, it's just an amazing device to see. And it makes me totally excited for what Apple is going to be announcing in the next 12 months. Because, yeah, if they start working on their follow up our CPU 40 M, one chip, then most likely, the performance is going to be even better. I must say that I really liked the technical aspects of the MAC studio device. But yeah, this had these m one Ultra chip, that it's like pretty wild what they're doing. They're just the sheer number of transistors that's on a single on a single die. And yeah, it's just great to see that this choice for Apple silicon is working out so well for for Apple and the performance that they're really getting out of these devices. So all in all, I liked the new green color on the new iPhones, or should I say new iPhones, recall it iPhones like that a introduced a new iPhone SE. And looking forward to any announcement today, we're gonna do in this second half of this year, because by that time, I think it's about time that I started looking into a new iPhone, I have a two and a half year old device right now, which still works very well for me, including the battery. So yeah, we'll just see. And, yeah, hopefully half year from now, I might start looking into my next Apple device, really. So let's dive into these news articles. Because I did a quite a long introduction. first article of this week is the how to use async await in synchronous code with tasks. It's an article by Natasha for diaphragm. And it's a quick overview of how you can make synchronous bits of codes asynchronous. So it's using the async modifier on a function declaration and then the await modifier when calling these functions, so really good to see, it really shows how simple it can be to do something asynchronously. It's a bit short circuit, because you have to take some things into account if you're doing asynchronous code execution. But still Just seeing how simple and easy this is, this is really nice. And second article is by a mod. It's Phillip Rucker. It's using the Location button in Swift UI for one time location access. It's again, a reasonably short article. And it showcases how you can use the Location button in Swift UI to basically get the location from the user each time the user presses this button. So what this allows you to do is you don't have to request the user location access. So you don't have to do an authorization challenge to the user. It's just if the user uses this button, then for a short duration, your app gets access to the authorized when in use authorization for location and temporary authorization that you get. So it's really convenient, it's saves you a lot of hassle, if you just want to get a location from the user one time. And it's very nice in line with the privacy guidelines that Apple tries to adhere to with their software developments. So if location access is used, very infrequently, maybe even only once, then using the Location button is the best option that you have. This article really shows how you can use this button what's involved with with implementing this button in your code. And it's quite straightforward. Just a few lines. And yeah, before you know it, you have like the location of the user available once or when you need it. Next article is by by Majeed, it's state restoration in Swift UI. So we always want to provide a great user interface and user experience to the use of our apps, right. And system can shut down your app when the user leaves it. And when you use it and relaunch the app, the as you would expect that you could pick up where you left off, right. But if you don't do anything special, the current state of the app is lost. And this is a bad user experience. So to avoid these kinds of situations, there's a concept called State restoration. And the state rep restoration mechanism is also available in Swift UI. And in article by Majeed, you get the basics of what you need to do to make sure that state restoration works in your Swift UI app. So have a read of this article. Because especially if, if you have a user interface that has some more involved structure in it, it's very useful for your end users to be able to put your app in the background and then later pick up the app where they left off without having to navigate back to the location in your app where they were when the background is your app. The third article is by Paulo Andre. It's called mixing Swift, Objective C SPM. And static frameworks, as always something new that you can work with as a software developer, a new framework, a new ID, a new CPU, architecture, new language, new dependency management. But so for any moderately large projects, it's impossible to just keep up with all this stuff, right? So you shouldn't even try, really, but otherwise, you'd be spending writing your code again. And again, every time that something new arrives. Paulo has been working on the secrets app for 10 years, I highly recommend this app because it's really neat. And there's been parts of this code that were written before before Arca was available, you can still find retainer release calls in that code today. And as Paulo mixes more and more new stuff with the old, he gets to deal with some tricky issues. And in this article, he goes into some details of one of these issues that he ran into, that basically involves things and challenges that you had to face when doing what the article title says, making swift Objective C Swift package manager and static frameworks. So have a read of this article, it really educates you a little bit on what kind of strange issues you you can run into if you have to maintain a code base for a longer duration. And yeah, it's just the fun reads and really enjoyed the technical challenge that Paolo presented and how he was able to overcome it. And then there's a final article that I think is a bit more thought provoking. It's called improved type safety with Swift Chen. And swift Chen is a as a utility that allows you to generate Swift code on the fly. So during your compilation, so Yeah, but why would you want to use a code generation tool, right? Well, typically, you would include a call to Swift to get Jen in your projects build phase, which will update all the generated code to reflect the current state of project and its resources. This helps you ensure that any potential issues related to remove assets callers, localized tax segues, storyboards, and those kinds of things are raised as compile time errors instead of runtime errors. Simply put, if a developer on your team accidentally removes a resource that is currently in use by project, you will now see a clear compile time message. Simply put, if a developer on your team accidentally removes a resource that is currently in use in your project, you will now see a clear compile time message instead of a crash at runtime when you attempt to access the resource, I think a very worthwhile thing, especially if you're dealing with larger code bases, right? So have a look at this article to see what swift Gen can can do for you and how you can integrate it with your project if this is something that you might find interesting. So those were the articles of this week. I just want to quickly wrap it up because I'm already way past 15 minutes. If you have any questions or feedback on the podcast, please let me know on Twitter at app Force One, and just sent me a message let me know what you think. I always look forward to your feedback and talk to you again next time.