Target-Action Explained in Swift

Aasif
By Aasif | Last Updated on December 22nd, 2021 6:41 am | 5-min read

Target-Action is a mechanism on iOS that’s used to call a certain function on a certain object. It’s prominently used in many iOS frameworks and libraries, although you may not have given it any thought until now. Let’s find out how it works! In this tutorial, you’ll learn: What target-action is, and what it’s used for What self means, when using it with target-action How to deal with selectors and function signatures How Objective-C and Swift interoperability affects target-a [...]

Read More

Generics in Swift Explained

Aasif
By Aasif | Last Updated on December 22nd, 2021 6:41 am | 5-min read

Generics are one of the most powerful features of the Swift programming language. They can be confusing at first, though! In this tutorial we’re going to take a look at how generics work in Swift, and what you can do with them. Here’s what we’ll get into: What problems do generics solve? Placeholder types and generic functions Generic type constraints with protocols Working with associated types Combining protocols and generics Table of Contents How to Use Generics in Swi [...]

Read More

FlatMap and CompactMap Explained in Swift

Aasif
By Aasif | Last Updated on December 22nd, 2021 6:40 am | 5-min read

Swift has a bunch of functions that are useful for transforming collections and sequences. In this tutorial, we’ll discuss map(_:), flatMap(_:) and compactMap(_:). Here’s what we’ll focus on: How map(_:) transforms a collection or sequence by applying a closure to it How flatMap(_:) can flatten an input array, after calling map(_:) How compactMap(_:) removes nil from the input array In a previous tutorial, we’ve discussed how you can use filter(_:) and reduce(_:). These hi [...]

Read More

Scale Your Business with Cold Email Using Mailshake

jinsen
By jinsen | December 15, 2021 3:25 pm  | 4-min read

Table of Contents Introduction Why Cold Email? Finding the right prospect list Making sure cold emails get delivered Cold email copywriting formats that work How to write follow-up emails Cold Email Templates to Get You Started Cold Email Masterclass Automating Your Cold Emails with Mailshake Conclusion Introduction There is no doubt that cold emailing is one of the most effective ways of acquiring new leads. It is quick, easy-to-do and a business doesn’t need to invest to [...]

Read More

Keypaths in Swift Explained

Aasif
By Aasif | Last Updated on December 22nd, 2021 6:40 am | 4-min read

With keypaths in Swift, you’re getting a reference to a property directly, as opposed to its value. You can pass these keypaths around in your code, and create all sorts of metaprogramming mayhem with it. Let’s find out more! What keypaths are and why they’re useful in Swift How to construct a keypath, including its type How you can create your own functions that use keypaths Tricks and caveats with WritableKeyPath, Any and generics And of course, plenty example code Table of [...]

Read More

Most Popular Posts