Assets catalogs are super useful to organize your app’s assets in Xcode. Drop graphics, images, icons, colors and vectors into an asset catalog and use them directly in your app’s code. In this tutorial, we’re going to discuss: How to add colors and images to an asset catalog How you use asset catalogs in practical iOS development Different sizes and scales for images Using colors with Dark and Light Mode How to use colors and images from an asset catalog in your code Tabl [...]
You use print() in Swift to print a string of text to the Console, or standard output. It’s super useful for debugging and finding out what’s going on in your code. In this tutorial, we’ll discuss how you can customize print() to code more productively. Here’s what we’ll get into: How do you use print() in Swift? Working with #file, #function and #line literals print()‘s separator and terminator Printing a description of custom Swift objects Table of Contents Writ [...]
In Swift, an initializer is a special init() function that we use to create objects of a particular class, struct or type. They’re used to “construct” an instance of the given type. In this tutorial, we’re going to discuss how initializers work, why they’re needed, and how you can write your own. We’ll focus on the different kinds of initializers, such as convenience initializers, what the consequences are of subclassing, errors you may face in day-to-day iOS development, and much [...]
In this tutorial, we’re going to discuss an approach for 2-way data flow between a web-based JSON resource and changing that data in your app. Getting data, displaying it, and sending changes back. The centerpiece is the @ObservedObject property wrapper, and we’ll also discuss how to use ObservableObject, @Published, @Binding, Combine, MVVM, and much more. Here’s what we’ll get into: How to set up 2-way data flow in a real-world Books app Working with @ObservedObject, @Binding and [...]
Random unique identifiers (UUIDs) are super useful in Swift programming. Imagine you’re storing objects in a database, and every object needs a unique ID. The generated ID needs to be unique, universally, across all devices, all users, all objects in the database. How do you generate such an ID?. Table of Contents Generating Random Identifiers with UUID What’s RFC 4122? UUIDs: Universally Unique Identifiers UUIDs in Practical iOS Development Further Reading Generating Rand [...]
Most Popular Posts
- Promises in Swift
By Aasif | December 13, 2021
- What To Build For First – Apple Or Android?
By Snigdha | December 29, 2017
- Bringing together Blockchain and AI technologies – the impact, advantages, and challenges!
By Abs | June 11, 2019
- What is Telecommuting? [Tips, Benefits, and Drawbacks]
By Ruchi Gohri | May 2, 2020
- The Advantages & Disadvantages of Building Mobile Apps for Small Businesses
By Snigdha | February 13, 2018