Working With JSON In Swift With SwiftyJSON

Aasif
By Aasif | December 23, 2021 12:38 pm  | 4-min read

Working with JSON can be cumbersome, but not if it’s up to SwiftyJSON! In this tutorial, you’ll learn how to work with JSON data in Swift with the SwiftyJSON library. Table of Contents What Is JSON? Parsing JSON With SwiftyJSON How SwiftyJSON Works Further Reading What Is JSON? Before we get started, let’s briefly discuss what JSON (“jay-son”) is. JSON stands for JavaScript Object Notation, and it’s a standardized file format that’s used to transmit data object [...]

Read More

How To Create a New Xcode App Project

Aasif
By Aasif | December 22, 2021 7:38 pm  | 4-min read

You’d think that creating a new app project in Xcode is as simple as File → New → Project…, but the wizard you’ll subsequently see actually hides a lot of interesting complexity. In this tutorial, we’ll discuss the various options you have when making a new Xcode project and their effect on your app. Here’s what we’ll get into: Templates for new app projects, like the ubiquitous (Single View) App Options for new projects, like code signing and SwiftUI App lifecycle Learni [...]

Read More

How To Fix Strong Reference Cycles in Swift

Aasif
By Aasif | December 22, 2021 7:09 pm  | 5-min read

A strong reference cycle causes a memory leak in your iOS app, and that’s a bad user experience. In this tutorial, we’ll discuss how you can resolve a strong reference cycle. Here’s what we’ll get into: What’s a strong reference cycle, and where do they come from? Resolving reference cycles with properties and closures Common pitfalls that result in a strong reference cycle Working with weak in properties and closures (And a lot of deliberately caused reference cycles for lea [...]

Read More

Sets in Swift Explained

Aasif
By Aasif | December 22, 2021 6:24 pm  | 5-min read

Sets in Swift are powerful. They’re similar to arrays and dictionaries, but also very different… The Set collection type is an interesting aspect of Swift programming. Let’s find out how you can use it! In this post, you’ll learn: How to use Set in Swift Why Set is such a powerful collection type How time complexity and hash tables affect Set How to compare sets, to find differences and similarities What ingredients a cappuccino and a latte have in common… Table of Con [...]

Read More

Structs In Swift Explained

Aasif
By Aasif | December 22, 2021 5:34 pm  | 4-min read

In Swift, you use structs to wrap and store complex data types. And they’re awesome! In this tutorial, you’ll learn how to use structs. We’ll also dive into the differences between structs and classes, and when you should use one or the other. Table of Contents What’s A Struct? Structs: Properties And Functions Structs Are Value Types When To Use: Structs vs. Classes Further Reading What’s A Struct? You use structs, or “structures”, in Swift to wrap and store co [...]

Read More