How to Change the Background Color of a View in SwiftUI
Learn different ways to set background colors on SwiftUI views, from simple color fills to gradients and materials.
// 28 articles available
Learn different ways to set background colors on SwiftUI views, from simple color fills to gradients and materials.
Learn how to prevent users from dismissing modal sheets by swiping down in SwiftUI using interactiveDismissDisabled.
Learn how to use the allowsHitTesting modifier to make views ignore touches, letting taps pass through to elements behind them.
Learn how to round only certain corners of a SwiftUI view using UnevenRoundedRectangle, custom shapes, and clipShape.
Learn how to resize images in SwiftUI using resizable(), frame(), and different content modes like scaledToFit and scaledToFill.
Learn how to show loading spinners in SwiftUI using ProgressView, including customization options and common loading patterns.
Learn how to properly support dark mode in SwiftUI using semantic colors, adaptive color assets, and color scheme detection.
Learn how to use SF Symbols in your SwiftUI apps, including sizing, coloring, animations, and finding the right symbol for your needs.
Learn how to use ToolbarSpacer to add fixed and flexible spacing between toolbar items in SwiftUI, new in iOS 26.
Failable initializers offer a cleaner alternative to if-let statements when your SwiftUI views depend on optional data.
Learn how to use the presentationDetents modifier to control sheet heights in SwiftUI, creating interactive bottom sheets similar to Apple Maps and Music.
Learn how to use the contentShape modifier to expand or customize the tappable area of your SwiftUI views, making buttons and interactive elements more user-friendly.
Safe areas keep your content visible and interactive. Here's how they work in SwiftUI and when you should ignore them.
How to add custom fonts to your SwiftUI app, use system font variants, and ensure your typography scales properly with Dynamic Type.
Understanding the difference between frame alignment and stack alignment is the key to centering views exactly where you want them in SwiftUI.
How to present a second sheet from within an already-presented sheet in SwiftUI.
Learn how to create a Material Design-style floating action button in SwiftUI that intelligently moves above the keyboard and avoids blocking text input fields.
How to detect when users scroll to the bottom of a list and automatically load more content.
Learn how to create a custom input accessory view that stays above the keyboard, similar to iMessage's input bar.
Learn how to build skeleton loading screens with animated shimmer effects in SwiftUI using gradients, AnimatableModifier, and reusable view modifiers for a polished loading experience.
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 accept user input in an alert using TextField or SecureField.
Learn the ways to scale a text view's font size to fit its parent view in SwiftUI.
Learn how to use DisclosureGroupStyle to create custom DisclosureGroup views in SwiftUI.
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.