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.
10:54
The scene-based API has confused many developers, especially those new to the platform. I hope the previous episodes have given you the foundation you need to use the API in your own projects. In this episode, I show you how dependency injection and the coordinator pattern fit into the scene-based API.
in UIKit
11:28
State restoration is an essential component of scene-based applications. Apple introduced view-controller-based state restoration several years ago in iOS 6. The company deprecated view-controller-based state restoration in iOS 13 in favor of user-activity-based state restoration. In this episode, you learn what user-activity-based state restoration is and how you can adopt it in your projects.
in UIKit
11:39
In the previous episode, we created a scene-based application using Xcode's new Single View App template. The target's Info.plist contains a key with name Application Scene Manifest, indicating that the application adopts the scene-based API. The value is a dictionary with two keys, Enable Multiple Windows and Scene Configuration. The value of Enable Multiple Windows is set to NO by default.
in UIKit
11:26
On iOS 13 and later, applications can support multiple windows on iPad. This is a welcome addition and it takes multitasking to another level on iPad. On iOS 12 and earlier, applications manage one user interface and, typically, one window. To add support for multiple windows, Apple was forced to drastically redesign the application and user interface life cycles on iOS.
in UIKit
Pull-to-refresh has become a common user interface paradigm in the mobile space. It made its introduction several years ago in Tweetie, a very popular Twitter client created by Loren Brichter.
in UIKit
Even though UICollectionView is incredibly flexible and versatile, trivial things are sometimes difficult to accomplish. UITableView, on the other hand, has more configuration options, but it is harder to customize. Sticky section headers, for example, are built into table views. Adding them to a collection view requires a bit of extra work.
in UIKit
Scene-based applications come with a few challenges for developers, one of them being dependency injection. How do you inject a dependency, such as a view model, into the root view controller of the window? That is the question I answer in this episode.
in UIKit
You are here because you want to learn how to add a gesture recognizer to a UIImageView instance. Right? In this post, I show you how to add a tap gesture recognizer to a UIImageView instance. Even though we only add a tap gesture recognizer, what you learn in this post applies to swipe gestures, pan gestures, pinch gestures, ... Remember that UIImageView is a subclass of UIView and has the same capabilities as its superclass.
in UIKit
Haptic feedback is great for providing the user with a tactile response. It adds that extra dimension to your application's user experience. Apple has made it very easy to integrate haptic feedback into your application thanks to the UIFeedbackGenerator class. You don't directly use UIFeedbackGenerator, though. UIKit defines three concrete subclasses you can use in your projects, UIImpactFeedbackGenerator, UISelectionFeedbackGenerator, and UINotificationFeedbackGenerator. Each of these classes has a clearly defined purpose. Let's take a look.
in UIKit
Drag and drop is a common pattern in mobile applications. The UIPanGestureRecognizer class makes detecting pan gestures fairly straightforward. The heavy lifting is handled by UIPanGestureRecognizer and its superclass, UIGestureRecognizer. In this post, I show you how to use a pan gesture recognizer in Swift. You learn how to drag and drop a view in its superview using the UIPanGestureRecognizer class.
in UIKit
Detecting swipes on iOS and tvOS is trivial thanks to the UISwipeGestureRecognizer class, a concrete subclass of the UIGestureRecognizer class. In this post, I show you how to use a swipe gesture recognizer in Swift. We create a simple application that detects swipe gestures by leveraging UIKit's UISwipeGestureRecognizer class.
in UIKit
Detecting gestures used to be tricky in the early days, but that changed with the introduction of the UIGestureRecognizer class in iOS 3.2. In this post, I show you how to use a tap gesture recognizer in Swift using the UITapGestureRecognizer class. We create a simple application and add a tap gesture recognizer to detect single and double taps.
in UIKit