iCloud Key-Value Store with NSUbiquitousKeyValueStore

Aasif
By Aasif | Last Updated on December 27th, 2021 9:07 pm | 4-min read

Ubi–what!? With the NSUbiquitousKeyValueStore you can sync key-value store data across iOS and Mac devices, via iCloud. It’s perfect for persisting user preferences to iCloud, and it’s simple to set up. In this tutorial you’ll learn: What a key-value store is How NSUbiquitousKeyValueStore is different than UserDefaults How to read from and write to NSUbiquitousKeyValueStore And how to sync data between iOS devices Table of Contents What’s A Key-Value Store? Writing Da [...]

Read More

The Nil-Coalescing ?? and Ternary Conditional :? Operators in Swift

Aasif
By Aasif | Last Updated on December 27th, 2021 9:08 pm | 5-min read

In this tutorial, we’re going to discuss how you can use the nil-coalescing operator and the ternary conditional operator in Swift. They’re both interesting bits of syntactic sugar, and they can help you write more concise, readable code. And that’s a good thing! Here’s what we’ll get into: What operators and operands are How to use the nil-coalescing operator How you can use the ternary conditional operator Real-life examples and tips and tricks for both Table of Conte [...]

Read More

Tuples Explained in Swift

Aasif
By Aasif | Last Updated on December 27th, 2021 9:10 pm | 4-min read

You use tuples in Swift to make ordered, comma-separated lists of values. They may look small, but they’re quite powerful! In this tutorial, we’ll discuss how you can use tuples in practical iOS development. Table of Contents What’s a Tuple? Decomposing Tuples Tuples in Everyday Swift Coding Further Reading What’s a Tuple? A tuple (pronounced “TEW-ple”) is an ordered, comma-separated list of values, wrapped in parentheses. Here’s an example: let flight = [...]

Read More

Singletons In Swift Explained

shivampal
By shivampal | Last Updated on December 27th, 2021 9:12 pm | 5-min read

A singleton is a class of which exactly one instance exists, that can be globally accessed. How do you create a singleton in Swift? And why should or shouldn’t you? In this tutorial, we’ll dive into singletons in Swift. You learn what the singleton design pattern is, and why it’s useful. We’ll discuss the syntax for creating singletons in Swift. And we’ll get into good and bad use cases for singletons. Table of Contents What Is A Singleton? Coding A Singleton In Swift When [...]

Read More

Dictionaries in Swift Explained

Aasif
By Aasif | Last Updated on December 27th, 2021 9:14 pm | 5-min read

A dictionary is a fundamental collection in Swift programming. With a dictionary you can store key-value data in your app. It’s a collection type, similar to array and sets, but completely different too. In this tutorial you’ll learn: How to create a dictionary, with literal syntax and initializers How to modify dictionaries, by adding, removing and changing elements How arrays and dictionaries are similar, and how they’re not What mutability is, and why it’s relevant Use cases [...]

Read More

Most Popular Posts