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.
Discover the newest tutorials on Swift and iOS development
Discover the newest tutorials on Swift and iOS development
Showing 685 to 696 of 716 posts
Converting a date to a string isn't difficult in Swift. The class that makes this task painless is DateFormatter (or NSDateFormatter if you are using Objective-C). The DateFormatter class is easy to use. Let me show you an example using a playground.
in Fundamentals
Every Swift developer runs into this error at some point. Class 'ViewController' has no initializers. To resolve this error, you need to understand an important aspect of classes. Swift requires that the stored properties of a class receive an initial value during initialization. That includes the stored properties the class inherits from its superclass.
in Fundamentals
Swift's final keyword is often overlooked or dismissed as not necessary. Applying the final keyword is a subtle technique to optimize your code in a powerful way. Let me explain what I mean by that.
in Fundamentals
I don't know about you, but I can't work in a code editor that doesn't show me line numbers. Xcode is no different. Line numbers in Xcode make it easy to quickly navigate to a piece of code.
in Xcode
Storyboards are great for building user interfaces, but it can sometimes be frustrating to debug the cryptic warnings and errors Xcode throws at you. In this episode of Swift Help, I show you how to avoid unreachable view controllers when working with storyboards.
in Fundamentals
You are probably familiar with Swift's range operator. You can create a range in Swift by using the closed range operator or the half-open range operator. Take a look at these example to freshen up your memory.
in Fundamentals
What are unary, binary, and ternary Operators? The answer to this question is surprisingly simple.
in Fundamentals
Like many other languages, the Swift programming language defines an operator to calculate the remainder of a division. This is convenient and it works as advertised. Most developers wrongly assume Swift's remainder operator is identical to a modulo operator in other languages. This isn't entirely accurate, though. Let's take a look at the basics first.
in Fundamentals
At the time of writing, Swift defines a single ternary operator, the ternary conditional operator. As the name suggest, a ternary operator operates on three operands. An operand can be a value or an expression.
in Fundamentals
Navigation controllers are indispensable on iOS, tvOS, and, more recently, Mac Catalyst. The UINavigationController class is easy to work with. A navigation controller is an example of view controller containment. Every navigation controller manages a stack of view controllers. View controllers can be pushed onto the navigation stack or popped from the navigation stack.
in Fundamentals
The map(_:) method has the ability to transform a sequence of elements. Let me show you what that means. We define a constant, strings, and assign an array of String objects to it. The array of strings contains the elements one, two, and three.
in Fundamentals
Most applications need to fetch data from a remote server and downloading images is a very common task applications need to perform. In this series, I show you how to download images using Swift. We take a look at several solutions. I show you the pros and cons of each solution and, most importantly, which pitfalls to avoid.
in Networking