Shortcut for ".compactMap { $0 }" in Combine (Swift) | The Swift Dev Blog
A Swift Combine extension to simplify removing nil values from publishers by replacing .compactMap { $0 } with .compactMap().
Trevor — Senior iOS Developer and Swift enthusiast sharing practical tutorials and real-world insights on Swift, SwiftUI, Combine, and iOS app development, with a passion for continuous learning and building high-quality App Store apps.
18 articles from this blog
A Swift Combine extension to simplify removing nil values from publishers by replacing .compactMap { $0 } with .compactMap().
A guide to automatically incrementing iOS/macOS app build numbers in Xcode using a post-archive run script action.
A guide to synchronizing build numbers and marketing versions across multiple Xcode targets from a single source of truth.
A guide to refactoring a private callback-based Swift API to use async/await, using continuations for a cleaner codebase.
A guide to refactoring callback-based network APIs in Swift to use the modern async/await syntax for cleaner, more readable code.
A tutorial on implementing Apple's Smart App Banner for iOS apps on a website, including deep linking setup.
A technical guide on customizing SwiftUI Divider colors and thickness using overlays, with examples and common pitfalls.
A SwiftUI tutorial on customizing alert button styles, including using button roles and global tint color overrides.
A developer shares their experience creating a SwiftUI app for syntax highlighting Swift code, built using John Sundell's Splash package.
A tutorial on building iOS widgets with SwiftUI, covering the TimelineProvider, entry views, and widget structure.
A guide to solving XCUITest failures on slow CI machines by waiting for text fields to gain focus before typing.
A guide to fixing a common iOS bug where cached launch screen images don't update, with a workaround using direct file placement.
A SwiftUI developer details improvements to a confetti animation library, focusing on realistic physics simulation for better visual feel.
Explains iterative and recursive solutions to merge two sorted linked lists in Swift, based on LeetCode problem #21.
A Swift tutorial solving the 'Longest Substring Without Repeating Characters' algorithm problem using a sliding window technique.
Learn how to use Swift's DispatchGroup to manage and synchronize multiple asynchronous API callbacks effectively.
A guide to debugging Xcode scheme pre and post actions by logging script output to a file, with a detailed shell script walkthrough.
A step-by-step tutorial on adding a basic iOS widget extension to an existing Xcode project using Swift and WidgetKit.