Showing a relative "Time ago" date in SwiftUI
Learn how to display human-readable relative timestamps like "5 minutes ago" or "yesterday" using RelativeDateTimeFormatter in your SwiftUI apps.
// 160 articles available
Learn how to display human-readable relative timestamps like "5 minutes ago" or "yesterday" using RelativeDateTimeFormatter in your SwiftUI apps.
How to generate random emoji characters in Swift using Unicode scalar ranges.
Learn how to implement undo/redo functionality in SwiftUI using UndoManager, including environment injection, registering actions, and creating undo buttons for professional editing experiences.
How to check available and total disk space on iOS devices using URL resource values.
Learn how to fix the Firebase Crashlytics dSYM files not properly being uploaded to Firebase after upgrading to Xcode 15/16.
Learn how to access and configure environment variables in Swift applications for configuration management, API keys, and feature toggles.
Learn how to align single and multiline text in SwiftUI.
Learn how to use ScrollViewReader and ScrollViewProxy to scroll a SwiftUI list to a specific item automatically.
Learn how to detect when a context menu is open in SwiftUI.
Learn how to create a WebView/WKWebView with a transparent/clear background in SwiftUI.
Learn how to accept user input in an alert using TextField or SecureField.
The keyboard doesn't always dismiss itself when you expect it to. Here are several approaches to dismissing it programmatically and through user interaction.
Learn how to create a modifier that limits the characters that can be entered in a TextEditor or TextField view in SwiftUI.
Learn the ways to scale a text view's font size to fit its parent view in SwiftUI.
Learn how to use a WKWebView as a quick way to load a GIF from a URL and display it in a SwiftUI view.
Learn how to use DisclosureGroupStyle to create custom DisclosureGroup views in SwiftUI.
Learn how to use kCFStringTransformToUnicodeName to get the system name for any emoji.
Learn how to prevent typing with your physical keyboard from dismissing the software keyboard when running your Swift app in the iOS simulator.
Objective-C has four ways to represent nothing. Understanding when to use each prevents subtle bugs and clarifies your code's intent.
Learn how to detect if a SwiftUI app is running in a Xcode Preview.
How to resolve the pod install error caused by Xcode 16's new folder-based group structure.
Learn how to force the navigation bar to show a background color in SwiftUI.
How to use the SwiftUI DisclosureGroup view to create collapsable content.
A practical guide to the different methods for adding single elements, multiple elements, and inserting at specific positions in Swift arrays.
Learn how to access your app's App Delegate from anywhere in your Swift code, including from SwiftUI views.
Learn multiple approaches to replace characters and substrings in Swift strings, from simple replacements to pattern-based transformations.
KVO lets you observe property changes without delegation or notifications. Here's how it works under the hood and how to use it correctly.
Before Swift closures, Objective-C had blocks. The syntax is different, but the power is the same. Here's how to use them effectively.
Every Objective-C class inherits from NSObject (usually). Here's what NSObject provides and why it matters for every object you create.
Both let you add methods to classes, but categories and class extensions serve different purposes. Here's when to use each.