A deep dive into SwiftUI rich text layout: How MarkdownView and RichText overcome AttributedString limitations. Learn to implement advanced Markdown rendering and native text selection on iOS/macOS with this technical guide by LiYanan.
Learn how to detect text truncation in SwiftUI using fixedSize and GeometryReader, and dynamically select adaptive layouts with ZStack and layoutPriority to ensure text content displays fully without being cut off.
Discover how SwiftUI's ZStack uses layoutPriority to compute size, allowing dynamic container resizing by toggling view importance—no ifs, no switches.
SwiftUI NavigationLink can cause performance issues by pre-building views; using equatable() on Equatable views prevents this and keeps navigation smooth.
Avoid overusing dismiss in SwiftUI. Embrace state-driven alternatives like Binding or custom environments for safer, testable, and maintainable UI logic
Explore how SwiftUI Environment powers modular and reactive app architecture with dependency injection, Observation integration, concurrency safety, and optimization strategies.
@State in SwiftUI does not support lazy initialization, causing premature instance creation. Learn how @LazyState enables lazy loading for Observable instances, optimizing performance.
The SwiftUI Animatable protocol allows for precise animation control, resolving issues like missing or inconsistent animations. Learn how animatableData can improve animation accuracy and stability in complex UI scenarios.
SwiftUI's scrollTargetBehavior provides precise scrolling control, but default paging misaligns in landscape mode. This article explores its limitations and implements a custom ScrollTargetBehavior for perfect paging alignment.
SwiftUI in Swift 6 fails with @State in view modifiers due to stricter concurrency & @MainActor. Learn solutions for alignmentGuide, scrollTransition & more.
Explore SwiftUI's `onChange` modifier “selective deafness” in multi-layer navigation. Understand why it might not trigger as expected and learn how to work around this issue.
Explore how to efficiently manage UserDefaults with SwiftUI's Observation framework. This article provides a complete solution for precise, responsive data handling, including the @ObservableDefaults macro.
Explore a SwiftUI Grid layout issue, learn analytical approaches & solutions for everyday SwiftUI development. Discover the root cause and a robust fix.
Explore common SwiftUI misconceptions, including its learning curve, cross-platform capabilities, and code volume. Understand its true potential for better app development.
Explore how to build an infinite four-direction scrollable pager in SwiftUI, overcoming limitations and leveraging custom gestures. Learn key techniques and considerations.
Explore the evolution of SwiftUI scroll control APIs, from WWDC 2019 to 2024. Learn about ScrollViewReader, scrollPosition, onScrollPhaseChange, & more.
Explore SwiftUI's TextRenderer for dynamic text effects. Learn to customize text rendering, create colorful animations, & use transitions. Dive into the new WWDC 2024 feature!
Explore SwiftUI spacing in-depth: understand what spacing = nil means, how default spacing is calculated, and when to use specific values. Learn practical spacing tips.
Explore SwiftUI's overlay and background modifiers, understanding their differences from ZStack, alignment logic, size control, and best practices for usage.
Explore @MainActor in SwiftUI: understand its use, solve concurrency issues, and learn best practices for Swift 6. Dive into View protocol updates & practical tips.
Learn how to integrate SwiftData with modern programming concepts in SwiftUI apps. This tutorial covers modularity, testability, and thread safety for robust data management.
Explore practical tips for using SwiftUI's lazy containers like List & LazyVStack. Enhance app performance, optimize resource use, and avoid common pitfalls.
Explore SwiftUI's powerful property wrappers: @UIApplicationDelegateAdaptor for UIKit integration, @AccessibilityFocusState for enhanced accessibility, and @FocusedObject, @FocusedValue, @FocusedBinding for focus management. Learn how they simplify app development and improve user experience.
Explore SwiftUI property wrappers like @FetchRequest, @SectionedFetchRequest, @Query, @Namespace, & @Bindable. Learn how they simplify data fetching & view management.
Explore essential SwiftUI property wrappers: @State, @Binding, @StateObject, @ObservedObject, @EnvironmentObject, and @Environment. Understand their core functions and when to use each.
Explore SwiftUI's geometryGroup() for handling animation anomalies and layout issues. Learn its usage, how it works, and alternatives for older SwiftUI versions.
Explore SwiftUI's ViewThatFits: learn its rules, ideal size, usage, and how to recreate it with Layout protocol. Master adaptive layouts for your iOS apps.
Explore GeometryReader's common problems in SwiftUI. Is it a curse or a blessing? Understand its layout, information retrieval, performance, and when to use it correctly. Includes new onGeometryChange API & replications.
Explore advanced TipKit: customize views beyond TipView, integrate with UIKit, enable cross-app data sharing, reuse Tip code, and address FAQs. Learn how to observe status & more!
Explore Apple's TipKit framework for displaying tips in your apps. Learn how to define, initialize, and customize tips using SwiftUI. Discover rules, events, and display strategies.
Explore two serious SwiftUI issues caused by delayed state updates: app freezes after sheet dismiss & navigation swipe, crashes when returning while scrolling. Solutions provided.
Explore SwiftUI Transactions: principles, functions, and distribution for precise animation control. Learn about implicit, explicit animations, and how to use them effectively. Also, cover the latest updates in WWDC 2023.
Explore the Observation framework in Swift 5.9: Learn its creation, usage, and benefits for SwiftUI performance. Understand how it improves upon KVO and Combine.
Explore SwiftUI 5's enhanced ScrollView with new APIs like contentMargins, safeAreaPadding, scrollIndicatorsFlash & more. Learn how to leverage these features for better scrolling experiences.
Explore SwiftUI preview's mechanism and limitations. Learn how it works via derived code, dynamic replacement, and XPC. Discover why previews crash & how to fix it.
Learn how to build cross-platform SwiftUI apps. This article covers key aspects like compatibility, data sources and adapting to multiple windows, based on a presentation at the SwiftUI Technology Salon.
Explore the timing of SwiftUI's onAppear modifier with evidence from new SwiftUI 4 APIs. Learn when onAppear is invoked: after layout, before rendering.
Optimize memory in SwiftUI + Core Data apps! This guide uses a sample to enhance performance, covering lazy views, managed objects, and row cache. Learn to reduce app crashes.
Explore SwiftUI's powerful layout system by using multiple methods to achieve one UI goal. Learn about offset, alignmentGuide, NameSpace, ScrollView and more.
Explore SwiftUI @State injection optimization, modal view timing, and data coordination using a 'mysterious code' example. Learn how @State impacts updates in different contexts.
Learn how to customize SwiftUI Button appearance and interaction using ButtonStyle & PrimitiveButtonStyle protocols. Add custom animations & control button behavior.
Learn how to efficiently fetch Core Data in SwiftUI with a custom FetchRequest using mock data for testing and previewing. Enhance your data handling strategies now!
Explore a modern approach to SwiftUI & Core Data data definition. Learn how to decouple views from managed objects using protocols for better flexibility & testability.
Explore the challenges of integrating Core Data with SwiftUI & TCA. Discover solutions to improve data definitions, testing, and concurrency, while retaining Core Data's strengths.
Create adaptive programmatic navigation in SwiftUI for different size modes, focusing on iPadOS & Stage Manager. Learn NavigationStack vs NavigationSplitView state management.
Explore SwiftUI insights from Ask Apple 2022. This article compiles key Q&A, offering solutions on Form vs List, performance, custom layouts, and more. A must-read for SwiftUI developers seeking best practices and tips.
Explore SwiftUI solutions from Ask Apple 2022 Q&A. This article provides developer insights on UIActivityViewController, contextAction, testing @State, and more. Learn from Apple engineers.
Explore the Composable Architecture (TCA), a powerful SwiftUI framework for complex app development. Learn its features, benefits, recent updates, and usage considerations.
Explore the nuances of SwiftUI's StateObject and ObservedObject. Learn their principles, differences, and when to use each for optimal data management and view updates.
Learn how to detect scrolling in SwiftUI using Introspect, Runloop, and PreferenceKey. Discover advantages and limitations. The IsScrolling library combines the last two methods for easy use.
Explore various methods to center views in SwiftUI, including Spacers, alignment guides like ZStack and frame, and GeometryReader. Understand each method's principles, scenarios, and considerations.
Explore how to implement keyword search and highlighting in SwiftUI Text using AttributedString. Learn to navigate search results and enhance user experience.
Explore how to mix text and images within SwiftUI's Text view. Learn techniques for dynamic sizing and text alignment. Includes practical examples and code.
Explore SwiftUI layout by imitating 'frame' and 'fixedSize' view modifiers. Learn about layout issues via examples, and the difference between appearance and essence.
Learn how to use SwiftUI’s Table for creating interactive, multi-column tables on macOS & iPadOS. Explore features like sorting, selection, & implementing similar functionality on other platforms.
Explore SwiftUI's best ways to open URLs, from buttons to text links. Learn how to customize URL handling and auto-detect links within text for a seamless user experience.
Explore how to make custom Swift property wrappers like @Published by enabling notifications to classes, using static subscript methods. Includes examples for @MyPublished, @PublishedObject, and @CloudStorage.
Explore SwiftUI’s animation mechanism with detailed explanations and code. Learn timing curves, VectorArithmetic, transitions, and how to master smooth UI effects.
Explore SwiftUI list optimization through a case study. Learn how to identify & resolve performance issues when handling large datasets, plus best practices for smooth navigation.
Explore SwiftUI's ViewBuilder by creating an imitation. Learn about view protocol, view types, and how SwiftUI handles views. Includes code examples for View, EmptyView, TupleView, and more.
Explore Swift result builders: custom containers, modifiers, compatibility, and limitations. Master ViewBuilder for SwiftUI view creation. Includes code examples.
SwiftUI Overlay Container is a customizable, efficient view manager for SwiftUI. Simplify view organization, transitions, animations, and more with ease. Try it now!
Explore how to customize gestures in SwiftUI, including swipe, press, and click. Learn to use view modifiers, GestureState, and integrate UIKit gestures. Updated for iOS 18.
Explore how to use NSUbiquitousKeyValueStore for cross-device data sharing in SwiftUI. Learn about its features, configurations, and practical usage with examples. Includes comparison to UserDefaults and integration with @CloudStorage.
Explore the SwiftUI view lifecycle, including struct instance creation, view value trees, and the nuances of onAppear and onDisappear. Learn to optimize your SwiftUI code.
Explore SwiftUI SafeArea: Get SafeAreaInsets, draw views outside safe area, and modify it. Learn about GeometryReader, ignoresSafeArea, and safeAreaInset.
Explore SwiftUI's onChange modifier: learn its features, usage, precautions, and alternatives. Understand how it observes values and triggers actions on change. Avoid common pitfalls for efficient coding.
Explore advanced SwiftUI TextField techniques: events, focus switching, keyboard settings, and more. Master onEditingChanged, onSubmit, and FocusState for enhanced user input.
Explore advanced SwiftUI TextField techniques: real-time formatting, invalid character filtering, and input condition validation. Learn to enhance your app’s text input.
Learn how to localize text in SwiftUI apps, covering string files, plural rules, & device-specific settings. Includes examples for dates, currencies, & more. Get practical localization tips.
SheetKit is a SwiftUI extension library for modal views, offering methods for presenting, dismissing, and managing sheets, fullScreenCovers, and custom bottomSheets. It enhances deep link handling and provides half-height modal support.
Explore how to enhance SwiftUI 3.0's interactiveDismissDisabled with functional extensions. Control sheet dismissal & get user gesture notifications. Learn the implementation!
Refactor SwiftUI state container with Swift 5.5's Async/Await. Learn how to handle side effects and ensure main thread updates for your app's state management.
Explore reasons for SwiftUI preview crashes with Core Data, learn to avoid them, and reliably preview views in Xcode. Includes tips on data management for previews.
Learn how to use UIKit views in SwiftUI, style them, and understand key considerations when wrapping a UITextField. Master UIViewRepresentable for seamless integration.
Explore efficient, secure @AppStorage usage in SwiftUI without third-party libs. Solve data type limits, tedious declarations, and injection issues. Includes central injection.
Explore insights and lessons learned while adapting a SwiftUI app for iPad. Learn about device detection, layout adjustments, and navigation challenges. Key code snippets included.
Explore lessons learned using CoreData in SwiftUI development over the past year. Discover insights on persistent storage, dynamic @FetchRequest, a transformation layer, and issues with NSPersistentCloudKitContainer. Avoid SQL thinking with CoreData.
Explore the open-source Swift and SwiftUI libraries used in Health Notes 2, including SwiftUIX, Charts, Introspect, SwiftDate and more. Enhance your iOS development!
Create a real-time form within a SwiftUI Sheet, manage cancel gestures, and respond to form status changes. Learn how to control Sheet dismissal based on user edits.
Learn how to build real-time responsive forms in SwiftUI with MVVM. This article covers input validation, data handling, and creating a seamless user experience.
Explore SwiftUI sheets, from basic usage to advanced techniques using item-based activation and reducer approaches to avoid crashes and improve code readability.
Explore SwiftUI List & ForEach: Discover performance issues with ForEach when handling large datasets & learn how to optimize with List or SwiftUIX. Learn when to use ForEach.
Create custom popup views easily with SwiftUIOverlayContainer. This library offers full control over animations, styles, & interactions, letting you focus on the view's content. Enhanced flexibility for SwiftUI popups.
With the continuous improvement of SwiftUI 2.0, I feel it's time to make a major upgrade to my app. I've always wanted to implement an elegant side menu effect in my app similar to the iOS mail app, and I searched online for a solution. However, most of the implementations are for UIKit and there are not many project libraries that are well adapted to SwiftUI. I ended up implementing one myself in Xcode 12.
Learn how to use ScrollViewReader in SwiftUI 2.0 for easy scroll positioning using IDs, a departure from offset-based solutions. Includes examples & drawbacks.
Explore SwiftUI 2.0's ProgressView for creating spinning indicators and linear progress bars. Learn to customize styles and use code examples to enhance your app.
Learn how to handle Universal Links in SwiftUI 2.0 using onOpenURL, a view modifier that simplifies URL handling, unlike AppDelegate. See example code and usage tips.
Explore SwiftUI 2.0's ToolBar, a versatile replacement for navigationbarItems, offering enhanced multi-platform support and cleaner syntax. Learn its basic usage and adaptations.
Learn how to use SwiftUI 2.0's Label for combining images & text. Explore custom styles & a custom Label widget for more control. Includes code examples.
Learn how to easily display maps in your Swift 2.0 app using MapKit. This tutorial covers adding map elements, tracking user location, and custom markers.
Explore SwiftUI 2.0's data flow enhancements with @AppStorage, @SceneStorage, and updated property wrappers. Learn to manage state and build efficient, modular apps.
Explore SwiftUI 2.0's App & Scene protocols, new data flow structures, and preset Scenes like WindowGroup & DocumentGroup. Learn system event responses and more.
Explore SwiftUI's @FocusedBinding for data sharing between views. Learn how to use FocusedValueKey to modify and bind data directly, bypassing traditional methods. Discover its uses and limitations.
Learn how to add custom menus in macOS using SwiftUI 2.0's Commands. Explore CommandMenu, Buttons, keyboard shortcuts, and more for enhanced app functionality.
Dive into SwiftUI 2.0's @StateObject, a new property wrapper for managing reference type data. Learn its lifecycle differences from @ObservedObject through practical examples and when to choose each for optimal data flow.
Explore SwiftUI's ObservableObject with a single source of truth. Learn how to boost efficiency by reducing dependencies and using alternative data management.
Explore SwiftUI's @State: its implementation, operation, and how it drives views with data. Learn to extend its functionality with examples. Dive into reactive programming.