Swift Conditional Compilation for Attributes

Using conditional directive hasAttribute to simplify code that needs to be conditionally compiled based on the presence or absence of certain attributes.

Apr 03, 2023#swift

How to Implement Type Erasure in Swift

Type erasure in Swift is a technique that lets you use generic protocols or protocols with associated types as concrete types, by hiding or erasing the specific type information.

Apr 01, 2023#swift#how-to

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

How to create mapped types in TypeScript

You can avoid repeating yourself by using mapped types to transform an existing type into a new type by mapping over its properties with some modifications.

Type Narrowing vs Type Casting in TypeScript

Type narrowing allows you to access properties and methods that are only available on certain types, and also helps TypeScript to catch errors and bugs at compile time.

An Introduction to AI and ML for Web Developers

By understanding the basics of AI and ML, we can begin to explore the many opportunities and challenges that these technologies present.

Mar 27, 2023#AI#ML

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.

How to Pass Data Up & Down in SwiftUI

You typically use State and StateObject to hold data as single source of truth, then passing around using binding, custom environment values, or preferences.

Mar 24, 2023#how-to#swiftui

JavaScript `this` binding in common contexts

In JavaScript, the "this" keyword is very flexible and confusing, evaluated at runtime, can have different values depending in which context it appears.