Donny Wals
  • Home
  • The Blog
  • The Newsletter
  • Speaking
  • Books
    • Practical Core Data
    • Practical Combine

donnywals

Understanding how DispatchQueue.sync can cause deadlocks

As a developer, you’ll come across the term "deadlock" sooner or later. When you do, it’s usually pretty clear that a deadlock is bad (the name alone implies this) and if you’ve experienced one in your code, you’ll know that your application crashes with EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) when a deadlock Read more…

By donnywals, 5 months5 months ago

Configuring error types when using flatMap in Combine

When you’re using Combine for an app that has iOS 13 as its minimum deployment target, you have likely run into problems when you tried to apply a flatMap to certain publishers in Xcode 12. To be specific, you have probably seen the following error message: flatMap(maxPublishers:_:) is only available Read more…

By donnywals, 6 months6 months ago

3 tips to work through a technical coding interview

If you’re a programmer looking for a job it’s very likely that you’ll have to do a coding interview at some point. Every company conducts these interviews differently. Some may have you work through several heavy computer science problems, others may present you with a task that’s related to the Read more…

By donnywals, 6 months6 months ago

Dispatching async or sync? The differences explained

When writing iOS apps, we regularly run into code that is asynchronous. Sometimes you know you’re writing something that will run asynchronously and other times you’re passing a completion handler to code that may or may not run asynchronously on a different dispatch queue. If you’re familiar with using DispatchQueue.main, Read more…

By donnywals, 6 months6 months ago

Implementing a one-way sync strategy with Core Data, URLSession and Combine

A common use of a Core Data store is to cache data from a remote resource locally to support offline functionality of an app. There are multiple ways to implement a caching mechanism and many of them don’t involve Core Data. For example, you could simply fetch a JSON file Read more…

By donnywals, 6 months ago

Understanding Swift’s OptionSet

Every once in a while I look at a feature in Swift and I fall down a rabbit hole to explore it so I can eventually write about it. The OptionSet protocol is one of these Swift features. If you’ve ever written an animation and passed it a list of Read more…

By donnywals, 6 months6 months ago

Fetching objects from Core Data in a SwiftUI project

When you’ve added Core Data to your SwiftUI project and you have some data stored in your database, the next hurdle is to somehow fetch that data from your Core Data store and present it to the user. In this week’s post, I will present two different ways that you Read more…

By donnywals, 7 months6 months ago

Using Codable with Core Data and NSManagedObject

If you’ve ever wanted to decode a bunch of JSON data into NSManagedObject instances you’ve probably noticed that this isn’t a straightforward exercise. With plain structs, you can conform your struct to Codable and you convert the struct from and to JSON data automatically. For an NSManagedObject subclass it’s not Read more…

By donnywals, 7 months7 months ago

Setting up a Core Data store for unit tests

Unit testing is an important skill in the toolbox of any engineer. Knowing how to write a reliable, robust test suite helps you write reliable and robust code. If you’ve followed my introduction to unit testing part one and part two, or if you’re experienced with unit testing you know Read more…

By donnywals, 7 months7 months ago

Using Core Data with SwiftUI 2.0 and Xcode 12

In Xcode 12 you can create projects that no longer use an AppDelegate and SceneDelegate to manage the application lifecycle. Instead, we can use Swift’s new @main annotation to turn a struct that conforms to the App protocol into the main entry point for our applications. When you create a Read more…

By donnywals, 7 months5 months ago

Posts navigation

Previous 1 2 3 … 18 Next
Categories
  • Books
  • Home
  • The Blog
  • The Newsletter
  • Speaking
Hestia | Developed by ThemeIsle