#swift

Found 83 articles tagged with #swift

Swift Task.init vs Task.detached

A task can run in the background and communicate with the UI thread when needed. To create and run a task in Swift, you can use initializers Task.init vs Task.detached.

Mar 31, 2023#swift#concurrency

6 ways to use "where" clause in Swift

The clause in Swift is a way to specify additional constraints on generic types, functions, associated types, or control flow statements….

Mar 30, 2023#swift

Swift Async/Await

Swift async/await is a new programming model introduced in Swift 5.5 (released on September 20, 2021) for writing asynchronous code that is….

Mar 28, 2023#concurrency#swift

The Problems with Completion Handlers in Swift

Asynchronous programming is an essential part of modern software development, allowing applications to perform long-running tasks without….

Mar 28, 2023#concurrency#swift

Type checking vs type casting in Swift

Swift provides several ways to check and cast types, which can be useful when working with objects that have been inherited from a superclass or implemented a protocol.

Mar 26, 2023#swift#types

What's New in Swift 5.9

This version will include features like convenience async stream methods, if and switch expressions, importing Objective-C forward declarations, discarding task groups.

Swift AnyObject, AnyClass, Any, and `any`

Swift has special types to work with nonspecific types, useful in certain scenarios because they provide a lot of flexibility in working with different types of data.

Mar 22, 2023#swift#types

A Comprehensive Comparison of Swift and Objective-C

Swift and Objective-C are two programming languages used for developing iOS, macOS, and watchOS applications. Objective-C has been the….

Swift Advanced Custom Pattern Matching

When you use pattern matching in Swift, the compiler uses the `~=` operator behind the scenes to match the value against each case pattern.

Mar 17, 2023#patterns#swift

A Beginner Guide to Pattern Matching in Swift

In Swift, pattern matching is a powerful feature that can be used to match values against a set of patterns, including ranges, optionals….

Mar 17, 2023#patterns#swift