Debug, Non-fatal Errors vs. Crashes
When we build apps, we often find ourselves dealing with fatal crashes. But have you ever wondered about the non-fatal errors? Here’s a very interesting article about the differences between non-fatal errors and fatal crashes.
Now that we’ve settled the difference, what about solving the crashes? Not all crashes are easy to identify and debug. Have you ever had a crash in which you had no idea what was going on, and no amount of testing allowed you to reproduce the issue? The ability to debug complex crashes is not something immediate. Take a look at these tips and tricks that will help you dominate those complex issues.
Testing
Continuing with our flow, let’s talk about some testing. Did you know you don't always need an XCode Project to test an iOS Swift package? Sometimes, you might just need to test non-UI Libraries. Here's How to Test an iOS Swift Package Without an Xcode Project. This will come in handy one day!
What about unit testing code that uses async/await? Can we write some robust unit tests for asynchronous code? This has always been particularly challenging, given that each test method is executed completely serially. Let's explore this further.
Optimization
Another important aspect of development is optimizing our build times. When projects get too big, it sometimes feels like we lose a lot of time waiting for them to compile. Check out what Spotify engineers did to reduce their build times by 70%. Using a “compile once, use everywhere” approach, they’ve managed to optimize their development flow and were kind enough to share it with the world.
Release
Once our debug process is complete and our crashes have been fixed, we are ready to release a new version to the AppStore. Holiday season is coming up and Apple has announced they will continue accepting submissions in App Store Connect throughout the upcoming holidays. But be aware that reviews may take longer to complete on November 24–28 and December 23–27. Have your apps ready and plan accordingly.
Worth the Time
Before finishing today’s issue of Swiftly Highlights, we wanted to share some good articles to read while your app compiles.
Async/await is part of the new structured concurrency changes that arrived in Swift 5.5 during WWDC 2021. Concurrency in Swift means allowing multiple pieces of code to run at the same time. Here are some code examples to help us understand it better.
Take a look at this well-compiled Cheatsheet of the most common custom environment value types we might define in our SwiftUI Code. SwiftUI is getting stronger every day; these examples will help keep you up to date.
Much of the code that we write on a daily basis essentially consists of a series of data transformations. Let’s take a look at how we can utilize Swift’s built-in concurrency system when performing such data transformations — Building Async and Concurrent Versions of forEach and Map.
One of the benefits of Swift’s built-in concurrency system is that it makes it much easier to perform multiple asynchronous tasks in parallel, which in turn can enable us to significantly speed up operations that can be broken down into separate parts. Take a look at Using Swift’s Concurrency System to Run Multiple Tasks in Parallel to explore this subject in depth.
As always, thank you for reading! See you next time.