How To: Using Notification Center In Swift

Aasif
By Aasif | November 26, 2021 6:22 pm  | 5-min read

With NotificationCenter you can broadcast data from one part of your app to another. It uses the Observer pattern to inform registered observers when a notification comes in, using a central dispatcher called Notification Center. In this tutorial we’ll find out how the notification center mechanism works, and how you can use it in your apps. As you’ll see, Notification Center is particularly useful for getting data from one part of your app to another. Before we get started, some quick [...]

Read More

MVVM and SwiftUI

Aasif
By Aasif | November 26, 2021 4:33 pm  | 5-min read

SwiftUI is not MVVM, but they go really well together. What’s the Model-View-ViewModel (MVVM) architectural pattern and how do you use it? In this tutorial, we’ll discuss how you can use MVVM to better organize your app’s code. Here’s what we’ll get into: How to see iOS development with SwiftUI through the lense of MVC and MVVM All the roles: models, views, controllers, view controllers, ViewModels Why SwiftUI and MVVM go so well together Tools for MVVM: bindings, @ObservedObj [...]

Read More

How To Find an Item in an Array in Swift

Aasif
By Aasif | November 26, 2021 1:43 pm  | 4-min read

How do you find an item in an array in Swift? Let’s find out! In this tutorial you’ll learn how to use the various generic functions to find matching items in an array. We’ll get into: The algorithm that’s used for finding items in an array How you can find the first and last indices of matching array items How to find items if you don’t exactly know what you’re looking for, with functions like first(where:) How to find all items in an array that match a given predicate [...]

Read More

How To Download, Install and Update Xcode

Aasif
By Aasif | November 25, 2021 7:59 pm  | 4-min read

Xcode is the Mac app that developers use to create apps for Apple’s platforms, like iOS. In this tutorial, you’ll learn how you can download and install Xcode on your Mac. Here’s what we’ll get into: 3 approaches to download and install Xcode on your Mac Tips and tricks to keep your Xcode up-to-date How to install Xcode betas on your Mac Table of Contents How To Download Xcode for macOS Installing Xcode on Mac Updating Xcode to The Latest Version Getting Xcode Beta Ver [...]

Read More

Struct vs. Class in Swift Explained

Aasif
By Aasif | November 25, 2021 6:51 pm  | 4-min read

What’s the difference between classes vs. structs? They’re so alike! It’s best to use structs by default, but why? And when should you use classes, then? In this tutorial, we’re going to take a look into structs vs. classes. When do you use a class, and when do you use a struct? What’s the difference between a struct and a class, and how does that affect practical iOS development? Structs are a fundamental aspect of Swift, and they can help to make your code more reusable, more f [...]

Read More

Most Popular Posts