What are enums in Swift?
Donny Wals
by donnywals
2d ago
Swift comes with types of objects that we can use to write type declarations. They all have their own distinct features, upsides, and downsides. In this post I’d like to zoom in on the enum type so you can get a sense of what enums are, and when they can be useful. In this post we’ll cover the following topics: Let's jump right in! In Swift, enums are values types that are declared using… Source ..read more
Visit website
How to add a privacy manifest file to your app for required reason API usage?
Donny Wals
by donnywals
1w ago
Apple has recently introduced a new requirement that makes it so that apps that use certain APIs for Apple's mobile platforms (iOS, iPadOS, tvOS, watchOS) must declare their intended use of certain APIs. This requirement has gone in effect on May 1st which means that any app updates or submissions that don't meet Apple's new requirements will be rejected with a "Missing API Declaration" Source ..read more
Visit website
What is defer in Swift?
Donny Wals
by donnywals
1w ago
Sometimes, we write code that needs set some state or perform some work at the start of a function and at the end of that same function we might have to reset that state, or perform some cleanup regardless of why we’re exiting that function. For example, you might have a function that creates a new Core Data object and depending on whether you’re able to enrich the object with data from the… Source ..read more
Visit website
Deciding between a computed property and a function in Swift
Donny Wals
by donnywals
1w ago
In Swift, we can use computed properties to derive a value from other values defined on the same object. Being able to do this is super convenient because it means that we don’t have to manually make sure that we update derived properties every time one of the “source” values changed. We’ll just recompute the property every time it’s accessed! This is very similar to having a function that takes… Source ..read more
Visit website
If case let in Swift explained
Donny Wals
by donnywals
1w ago
In Swift, we can use the keyword in multiple places. Most commonly, a is used in switched but since you’re here, you might have seen a in combination with an statement. In this post, we’ll explore different places where we can use the keyword to perform something called pattern matching in Swift. Pattern matching is a powerful feature of Swift that allows us to perform highly elegant… Source ..read more
Visit website
How Enterprise level CI/CD with AppCircle helps you scale
Donny Wals
by donnywals
2w ago
As teams grow and companies mature you’ll often find that it gets harder and harder to manage processes that seemed to be so simple before. When I worked in startups one of my favorite things was how quick the feedback cycle was on pretty much everything I did. When someone designed a new feature we could build that and ship it on Testflight as quick as a couple of hours. If the designer liked… Source ..read more
Visit website
What are lazy vars in Swift?
Donny Wals
by donnywals
2w ago
Sometimes when you’re programming you have some properties that are pretty expensive to compute so you want to make sure that you don’t perform any work that you don’t absolutely must perform. For example, you might have the following two criteria for your property: If these two criteria sound like what you’re looking for, then lazy vars are for you. A lazy variable is defined as follows… Source ..read more
Visit website
Dispatching to the Main thread with MainActor in Swift
Donny Wals
by donnywals
2w ago
Swift 5.5 introduced loads of new concurrency related features. One of these features is the annotation that we can apply to classes, functions, and properties. In this post you’ll learn several techniques that you can use to dispatch your code to the main thread from within Swift Concurrency’s tasks or by applying the main actor annotation. If you’d like to take a deep dive into learning… Source ..read more
Visit website
How to use experimental Swift versions and features in Xcode?
Donny Wals
by donnywals
3w ago
If you’re keen on reading about what’s new in Swift or learn about all the cool things that are coming up, you’re probably following several folks in the iOS community that keep track and tell you about all the new things. But what if you read about an upcoming Swift feature that you’d like to try out? Do you have to wait for it to become available in a new Xcode release? Sometimes the answer is… Source ..read more
Visit website
Actor reentrancy in Swift explained
Donny Wals
by donnywals
1M ago
When you start learning about actors in Swift, you’ll find that explanations will always contain something along the lines of “Actors protect shared mutable state by making sure the actor only does one thing at a time”. As a single sentence summary of actors, this is great but it misses an important nuance. While it’s true that actors do only one thing at a time, they don’t always execute function… Source ..read more
Visit website

Follow Donny Wals on FeedSpot

Continue with Google
Continue with Apple
OR