#swift

Found 81 articles tagged with #swift

When to use weak vs unowned references in Swift

Remember, weak is for cases where the reference might become nil, while unowned assumes it won’t. Choose wisely based on your specific use case.

Jul 07, 2024#swift#xcode#debug

What's New in Swift 6

Swift 6 is set to launch in 2024, alongside Xcode 16 in September. This update builds on the features introduced in the Swift 5.x series, such as async/await, existentials, and macros.

Jun 19, 2024#swift

A deep dive into @MainActor in Swift

This is a global actor that describes the main thread, pretty handy given how often you need to make quick changes that update the user interface.

Apr 24, 2024#swift#concurrency

An example using builder pattern in Swift

The builder pattern allows you to create objects with varying configurations without the need to have multiple constructors with different parameter combinations.

Different ways to parse JSON data in Swift

Choose Codable for well-defined JSON structures, JSONSerialization for simple parsing tasks or legacy codebases, and SwiftyJSON for dynamic or exploratory parsing needs.

Apr 07, 2024#swift#json

Difference between KVO and KVC in Swift

While KVO and KVC are related and both are part of Cocoa's observation mechanism, they serve different purposes and operate at different levels of abstraction.

Apr 04, 2024#swift#objc#ios

Dependency Injection (DI) in Swift

In DI, dependencies are provided to it from an external source, typically through constructor injection, property injection, or method injection instead of a class creating itself.

How to handle multiple async tasks in Swift

Swift offers a few ways to handle multiple asynchronous tasks, depending on whether you need them to run concurrently or wait for their results.

Mar 23, 2024#swift

Difference between private and fileprivate in Swift

In Swift, private provides the strictest level of access control. You should only use fileprivate when you have a specific reason to allow access from other parts of the same file.

Mar 09, 2024#swift#comparison

What's New in Swift 5.10

Swift 5.10 accomplishes full data isolation in the concurrency language model. This important milestone has taken years of active development over many releases.