Aasif
Aasif
|| |

Aasif Khan is an SEO specialist with an experience of 10+ years in the digital marketing industry. Today, he is an expert in SEO, SMO, SEM, and is also one of the top contributors to Appy Pie Blog. He writes about the ongoing trends in the digital marketing industry. He loves working out in the gym and also spares some time for hobbies like playing cricket and reading books among other things.

How To: Using Notification Center In Swift

Aasif
By Aasif | November 26, 2021 | 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 | 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 | 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 | 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 | 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

Displaying Alerts with UIAlertController in Swift

Aasif
By Aasif | November 25, 2021 | 5-min read

In this tutorial, you’ll learn how to use the UIAlertController class to display alert dialogs in your iOS app. We’ll dive into setting up the alerts, responding to user actions, and getting input from the user with text fields. The UIAlertController is a basic but important part of the iOS SDK, and it’s the default way to ask users to confirm an action. On top of that, UIAlertController also supports the action sheet, which is a convenient dialog style that allows your app’s users to[...]

Read More

Networking in Swift with URLSession

Aasif
By Aasif | November 25, 2021 | 5-min read

In this tutorial, we’ll discuss how you can use the URLSession suite of components, classes and functions to make HTTP GET and POST network requests. You’ll learn how to validate response data, and how to add additional parameters like headers to requests. Almost every app will communicate with the internet at some point. How does that work? What Swift code can you use to make HTTP(S) networking requests? Fetching and downloading data from and to webservices is a skill any pragmatic iO[...]

Read More

How To: Pass Data Between View Controllers in Swift

Aasif
By Aasif | November 25, 2021 | 8-min read

If your app has multiple User Interfaces (UIs), you’ll want to move data from one UI to the next. How do you pass data between view controllers in Swift? Passing data between view controllers is an important part of iOS development. You can use several ways to do so, and all of them have distinct advantages and drawbacks. The ability to pass data between view controllers with ease is affected by your choice of app architecture. App architecture affects how you work with view controllers,[...]

Read More

For Loops in Swift (How To)

Aasif
By Aasif | November 24, 2021 | 5-min read

A for loop is a fundamental concept of programming. You can repeat code with a for loop, and make your code more expressive and elegant. You use for-in, while and repeat-while to loop in Swift. In this tutorial you’ll learn how to use the for-in loop, with collections and ranges, and how to use other approaches like while and repeat-while. The for loop in Swift is a super useful tool in any developer’s toolkit, so it’s a must to master as a practical iOS developer. Table of Conten[...]

Read More

Working with Codable and JSON in Swift

Aasif
By Aasif | November 24, 2021 | 6-min read

You can use Codable in Swift to encode and decode custom data formats, such as JSON, to native Swift objects. It’s incredibly easy to map Swift objects to JSON data, and vice versa, by simply adopting the Codable protocol. As a pragmatic iOS developer, you’ll come across JSON sooner rather than later. Every webservice, from Facebook to Foursquare, uses the JSON format to get data into and out of your app. How can you encode and decode that JSON data to Swift objects effectively? In thi[...]

Read More