Register when the pointer enters and exists view's bounds and get the mouse cursor location with onContinuousHover() modifier.
Find out how text modifiers are different from view modifiers in SwiftUI and how we can use them in our code to style portions of text.
Create a chart with the Swift Charts framework to show UV index throughout the day inspired by the iOS Weather app that dims the area up to the current time.
Use the accessibilityShowButtonShapes environment value to change the appearance of custom buttons and links embedded in Text views to make them more accessible.
Add a gradient to a bar chart that stretches from top to bottom of the plot area rather than filling each individual mark.
Generate xcloc files that can be sent to translators directly from SwiftUI code and import translations back to create Localizable.strings files.
Programmatically dismiss presentations and pop views from the navigation stack in both pure SwiftUI and hybrid UIKIt/SwiftUI apps with the help of the dismiss action.
Let users rename items from the navigation title in the toolbar using the new navigationTitle() modifier that takes a binding.
Make all parts of your app readable for users with low vision using the large content viewer APIs.
We can customize how the user navigates through focusable views in our macOS apps with the help of the new focusSection() modifier.
Build a bar chart using data with values of type Measurement<UnitDuration> that doesn't conform to Plottable by default.
Let users configure the visible items in the center area of the toolbar on iPadOS 16 to suit their personal workflows.
Learn how to use the new openWindow action in SwiftUI to programmatically present new windows in macOS 13.
Take advantage of the new URL APIs in iOS 16, which let us obtain paths to system directories more easily without the need to use FileManager methods.
While reading the current color scheme is quite easy in SwiftUI, setting a color scheme requires us to carefully consider what effect we are trying to achieve.
Visualise data distributions by building a histogram and a 2D density plot with the new Swift Charts framework.
Starting from iOS 16 and macOS 13 we have a SwiftUI API to request App Store reviews. We can read requestReview property from the environment and call it as a function at the appropriate time.
In Swift 5.7 that comes with Xcode 14 we can check if two values of type Any are equal, because we can cast values to any Equatable and use any Equatable as a parameter type.
Find and replace feature is automatically supported by SwiftUI TextEditor, but we also have some APIs to customize its behavior, such as disable replace or present the find UI programmatically.
New ViewThatFits API introduced at WWDC 2022 lets us create more flexible layouts in constrained space. It can even help us detect if text is truncated and adapt our views accordingly.
Build a custom ridge chart with the new Swift Charts framework to show the distribution of a numeric variable for several groups.
In this article we'll go over all the API additions in iOS 16 to present and customize resizable sheets in SwiftUI. We'll also look at API limitations comparing to UISheetPresentationController in UIKit.
Use the new NavigationSplitView API with a column visibility parameter to programmatically control the visibility of the sidebar in multicolumn navigation in SwiftUI.
Explore the capabilities of the new Swift Charts framework introduced at WWDC 2022 while making a stream graph with custom colour gradient and text labels.
Let's try out the new SwiftUI navigation APIs introduced in beta 1 for iOS 16 and macOS 13: NavigationStack, NavigationSplitView and ways to set up programmatic navigation.
Find out about different ways we can provide feedback about new APIs to Apple engineers, ask questions during WWDC and get help from Apple experts and wider developer community.
Take a closer look at AttributedString type and different attribute scopes it can contain. Explore how Apple system frameworks interpret available attributes and how to create your own.
Add custom encoding and decoding logic for SwiftUI Color that is not Codable by default to be able to save it to disk or remote database.
Look into how to insert images, formatted data, attributed strings etc. inside SwiftUI Text views by leveraging the power of string interpolation in LocalizedStringKey.
Present multiple sheets at the same time one on top of the other like, for example, in Apple Calendar app when adding a new calendar.
Set a keypath to your model properties as FocusState value to avoid declaring custom enums to programmatically set focus and respond to focus changes.
Build sidebar navigation for your macOS app with the help of selection binding in List view and use SceneStroage for state restoration.
Learn how to rapidly evaluate a polynomial function of variable size on the GPU without needing to write C++ Metal shaders.
Explore how to get around the Swift language limitation of not being able to define static mutable properties in generic types and protocol extensions.
Make use of the focused scene value API to pass data from the focused scene to the commands section of the app.
Build a system for conforming polymorphic types to Codable protocol, that can be reused in multiple situations.
Customize encoding and decoding logic for individual fields of codable types in Swift by defining codable property wrappers.
Avoid the conflict between the drag gesture and editing of text fields inside list rows and make focusing on text fields easier.
Change the style of navigation view in document based apps, by hiding the default view and adding our own.
Make an editable list of items in SwiftUI that automatically adds an empty text field for users to easily add new entries.
Add custom information and copyright to your app's About window on macOS when using the SwiftUI app lifecycle.
Integrate with UndoManager in SwiftUI by building a reusable UndoProvider view that can be used with any binding.
Add RawRepresentable conformance to a custom type that represents a setting or a view state in SwiftUI to be able to save it in AppStorage or SceneStorage.
Remove the default TextEditor background on iOS and add a placeholder that is not currently supported in TextEditor out of the box.
Let users preview various file formats such as Images, Live Photos, PDFs etc. in your SwiftUI app using QuickLook framework.
Explore how to add support for local network privacy if, for example, your app uses URLSession to access local servers.
Programmatically scroll SwiftUI ScrollView to a newly added item by combining ScrollViewReader and onChange() view modifier.
Implement state restoration in an example tab-based app that stores records of different types of trips.
Build an example social network with Django Channels Rest Framework that lets you subscribe to a hashtag in realtime.
In this article we will look into how to create a custom hover effect in SwiftUI and how to abstract this logic into a reusable view modifier.
View and manage files created by your app on the simulator, browse the Documents folder or Core Data SQLite Database.
Programmatically scroll SwiftUI List to a particular item, using the fact that its internal implementation is based on UITableView.
Publish database changes to subscribed WebSocket clients using Django Channels Rest Framework.
Explore the features of Django Channels REST Framework for building WebSocket API consumers with Django.
Make Swift 5 enums that have multiple associated values of different types conform to Encodable and Decodable protocols for saving data to disk or interacting with Web APIs.
Add keyboard shortcuts to a SwiftUI iOS/iPadOS app to improve user experience when using your app with an attached hardware keyboard.
If you need to release an app built with an older version of Xcode, but want to test the app on the beta iOS simulators, you can follow the steps described in this article to transfer your build to the beta simulator.
Build a WebSocket server in Node.js using ws library and test it with a WebSocket client app.
Define and use custom environment key-value pairs in SwiftUI to pass values to the hierarchy of child views.
Make a scrollable view in SwiftUI scroll the active text field into visible range when the keyboard appears on screen in iOS 13.
In this article we would like to share what we learned about buttons in SwiftUI List rows when developing our apps.