Learn Swift and iOS Development
Master iOS development through in-depth tutorials and comprehensive courses on Swift, SwiftUI, UIKit, Core Data, and more.
Master iOS development through in-depth tutorials and comprehensive courses on Swift, SwiftUI, UIKit, Core Data, and more.
A few weeks ago, a reader was having problems getting up to speed with CocoaPods. While CocoaPods isn't too difficult to use, it can be challenging if you haven't used a dependency manager before. After running pod install, CocoaPods outputted the following message.
5:59
The JSONDecoder and JSONEncoder classes make working with JSON a breeze. The true star is Codable, though. Codable, a type alias for Decodable & Encodable, is flexible and provides a lot of functionality for very little effort. From time to time, you run into a situation that makes you scratch your head. This episode covers one such situation. How do you encode null using JSONEncoder? The good news is that the solution is fairly straightforward.
4:24
Xcode is a pretty complex piece of software and it changes with every major release. Apple's IDE (Integrated Development Environment) has dozens and dozens of tiny secrets, which you only discover the more you use it. In this episode, I share five tips that I use every day and could not do without.
3:17
I love that access control is an integral component of the Swift programming language. Access control lets you carefully control what properties and methods an entity exposes. Rigorously applying access control has significant benefits. You can even improve performance through access control.
2:50
I don't like long or complex viewDidLoad() methods. The viewDidLoad() method of a view controller should be short and easy to understand. The tip I am about to share with you helps declutter the viewDidLoad() method of the view controllers in your projects.
6:45
To be productive and efficient, you need to know your tools. For a Swift or Cocoa developer, that means mastering Xcode. While Xcode is a complex piece of software with a fairly steep learning curve, the tricks listed in this episode should significantly boost your productivity.
6:47
The basics of Swift are easy to learn, but the language has evolved significantly over the past few years. The more I use the language, the more I learn about it and discover its lesser known features. In this episode, I would like to share a handful of tips and patterns I have picked up over the years. They are easy to implement and have the potential to transform messy code into elegant, readable code.
7:40
I make ample use of self-executing closures in a range of scenarios. In this episode, I show you several patterns in which self-executing closures come in useful and can improve the code you write.
13:27
I hope we can agree that source control is a necessity for every software project. The most popular option for Cocoa and Swift development is Git. I've been using it for many years and I continue to appreciate its power and simplicity every day. It's easy to pick up thanks to its gentle learning curve. If you're not comfortable using Git from the command line, then take your pick from the many native clients for iOS and macOS.
12:01
A brand new Xcode project defines two build configurations, Debug and Release. Most projects define one or more additional build configurations for various reasons. This isn't new and it's a good practice to use build configurations to tailor a build to the specific needs of the environment it's going to be deployed to.
3:54
I'm not a fan of random string literals in a project and I always try to find solutions to avoid them. In today's episode, I show you an elegant solution to rid a project of string literals.
If you're watching this, then I assume you're familiar with Swift extensions. A Swift extension allows you to add functionality to a type, a class, a struct, an enum, or a protocol. But extensions are more powerful than that. In this episode, I'd like to show you four clever uses of Swift extensions.
Even though forms aren't difficult to implement on iOS, they can be frustrating to use. In today's tutorial, I'd like to share five simple tips that can drastically improve the usability of the forms in your iOS applications.
A technique I use in almost every project leverages the power of categories (Objective-C) and extensions (Swift). This technique is very easy to implement and it rids your project of magic numbers and code duplication. Let me give you an example.
There are multiple notations for defining colors. The hex notation is probably my favorite because it is easy to store as a string or pass it around as a numerical value. In Mastering Core Data With Swift, I use it to store a color in a SQLite database.
Swift is evolving at a rapid pace and developers are still figuring out the dos and don'ts of the language. I have seen some fantastic talks over the past few months. These are the ones you should watch.
I love podcasts. It is a fantastic medium that continues to grow in popularity. I am subscribed to a bunch of podcasts, ranging from business podcasts to podcasts about development and technology. Today, I list seven of my favorite podcasts for Cocoa developers.
Swift is becoming more popular by the day and new initiatives pop up left and right. In this article, I list six projects I stumbled upon in my never-ending search for audacious initiatives.
There are many respected developers in the Swift and Cocoa communities. In this article, I list ten people that you should follow.
Most mobile applications connect to one or more services in the cloud. The services you connect to can differ depending on the development phase the project is in. For example, you may be using a staging environment during development, a testing environment during beta testing, and a production environment for the App Store. Switching between environments can be cumbersome and prone to errors.
It is important that you structure the code you write as best as you can. This may feel tedious at first because you don't exactly know what goes where. Over time you develop a structure that fits and you don't even think about it. It becomes second nature. By adding structure, it is much easier to navigate a project and stay on top of the code you write.
In this quick tip, I show you how to calculate the distance between two locations using the Core Location framework. Let's say you have two sets of coordinates and you want to calculate the distance between them. In this example, we use a tuple to store the latitude and the longitude of a set of coordinates.