Quantcast
Channel: SwiftUI Archives - SwiftLee
Browsing all 21 articles
Browse latest View live

Sheets in SwiftUI explained with code examples

Sheets in SwiftUI allow you to present views that partly cover the underlying screen. You can present them using view modifiers that respond to a particular state change, like a boolean or an object....

View Article


How to use FormatStyle to restrict TextField input in SwiftUI

A custom FormatStyle can help you control the allowed characters of a SwiftUI TextField. You might want to allow numbers only or a specific set of characters. While you could use a formatter in many...

View Article

Introducing Roadmap: Offer Public Feature Voting

Roadmap is a new open-source framework written completely in Swift and SwiftUI, allowing you to integrate feature voting functionality for your apps. While developing apps, spending your time on the...

View Article

View Composition using ViewModifiers in SwiftUI

View Composition allows you to create reusable components to create enriched views. You can extract logic into reusable components using the ViewModifier protocol in SwiftUI and set up your code for...

View Article

Deeplink URL handling in SwiftUI

Deeplinks allow you to open your app and navigate into a specific location right after launch. An example could be deep linking to a recipe or movie based on the tapped link. You can determine the...

View Article


Universal Links implementation on iOS

Universal Links allow you to link to content inside your app when a user opens a particular URL. Webpages will open in the app browser by default, but you can configure specific paths to open in your...

View Article

ContentUnavailableView: Handling Empty States in SwiftUI

ContentUnavailableView is a SwiftUI view introduced in iOS 17 during WWDC 2023. It allows you to handle cases of networking failure or empty search results. It’s essential to explain an empty state and...

View Article

App Intents Spotlight integration using Shortcuts

App Intents have been new since iOS 16 and offer a programmatic way to service your app’s content and functionality to Siri and the Shortcuts app. New in iOS 17 is the option to surface App Shortcuts...

View Article


Debugging SwiftUI views: what caused that change?

Debugging SwiftUI views is an essential skill when writing dynamic views with several redrawing triggers. Property wrappers like @State and @ObservedObject will redraw your view based on a changed...

View Article


SFSafariViewController in SwiftUI: Open webpages in-app

SFSafariViewController can be used to let your users open webpages in-app instead of in an external browser. While the view controller works great for UIKit, getting it to work in a SwiftUI app might...

View Article

@Observable Macro performance increase over ObservableObject

The @Observable Macro was first introduced during WWDC 2023 to replace ObservableObject and its @Published parameters. The macro allows you to remove all published properties while still being able to...

View Article

ScrollView Bounce Behavior configuration in SwiftUI

A ScrollView bounce behavior configuration allows you to define whether a scrollable view bounces when reaching the end of its content. Whether it’s a horizontal or vertical scrolling list, you can...

View Article

How to use @ScaledMetric in SwiftUI for Dynamic Type support

The @ScaledMetric property wrapper in SwiftUI allows you to adopt custom values to dynamic type settings. Your custom values will scale proportionally whenever the user changes the dynamic type...

View Article


Key press events detection in SwiftUI

Key press events detection in SwiftUI allows you to respond to a keyboard key like return (enter), shift, command, and more. While mostly Mac apps use keyboard events, you must consider adding support...

View Article

Identifiable protocol in SwiftUI explained with code examples

The Identifiable protocol in SwiftUI allows you to add a unique object identity. The protocol requires a single ID property of any hashable type, making it a flexible protocol for all kinds of...

View Article


Using @Environment in SwiftUI to link Swift Package dependencies

The @Environment property wrapper in SwiftUI allows you to read values from a view’s environment. You’re able to configure an environment value yourself or make use of the default available values....

View Article

MVVM: An architectural coding pattern to structure SwiftUI Views

MVVM (Model-View-ViewModel) is an architectural coding pattern for structuring SwiftUI views. The goal of the pattern is to separate the view definition from the business logic behind it. Your views...

View Article


@Previewable: Dynamic SwiftUI Previews Made Easy

Xcode 16 introduced the @Previewable macro for SwiftUI Previews, allowing you to use dynamic properties inline in previews. You’ll be able to make richer and more dynamic previews of your SwiftUI views...

View Article

Why macOS Development is Perfect for Indie Developers

Building apps for macOS offers developers a fantastic opportunity to expand their skills, create useful utilities to solve their problems, and begin their journey as indie developers. I’ve invited...

View Article

Memory consumption when loading UIImage from disk

Memory consumption can quickly increase if you load many images from the disk using UIImage. You’ll generally load images from a remote address or via an asset catalog. However, you have bundled images...

View Article
Browsing all 21 articles
Browse latest View live