Lighten or darken colors in SwiftUI views using the brightness(_:) modifier.
To copy a string to the clipboard on macOS, we need to first clear it using clearContents(), unlike on iOS, where UIPasteboard automatically overwrites the existing data.
SwiftUI provides a simple way to set a view's background to a shape, like a capsule or rounded rectangle, using the background(_:in:fillStyle:) modifier.
Configure a file target membership in Xcode to restrict it to specific platforms, avoiding the need for conditional compilation checks when the file contains platform-specific code.
Xcode 16 introduced the @Previewable macro, making it easier to preview SwiftUI views with bindings.
Use localizedStandardRange(of:) in Swift for flexible, locale-aware, case and accent-insensitive string searches, providing a user experience similar to system-wide searches.
Sorting arrays in Swift can be made more concise and readable by using comparison operators as closures in the sorted(by:) method.
Starting from iPadOS 18, SwiftUI now allows us to present a form sheet, similar to UIModalPresentationStyle.formSheet.
Take advantage of the new macOS 15 API to update SwiftUI views when modified keys are pressed.
Learn how to use MapKit and SwiftUI to apply a gradient that follows a polyline, enhancing the visual appeal of your maps.
When we need to compare arrays based on custom criteria in Swift, we can use elementsEqual(_:by:) method. It allows us to define custom comparison logic with a closure, offering more flexibility than using == operator.
Learn how to use NWPathMonitor as an async sequence for real-time network status updates in your SwiftUI views.
Add custom foreground styles such as gradients to words inside Text view in SwiftUI in iOS 17.
In Xcode 15 code completion we can view all the possible permutations of function parameters by pressing the right arrow key.
The focusable() modifier now available on iPadOS 17 allows us to provide full keyboard navigation, even including custom views not focusable by default.
Starting from iOS 17 and iPadOS 17 we can now use ControlGroup to display a horizontal collection of actions in a context menu.
Swift 5.9 introduces the use of if/else statements as expressions, simplifying value returns, variable assignments, and enhancing code readability.
Ensure that complex SwiftUI buttons have the correct blending in pressed state by applying the compositingGroup() modifier.
Starting from Xcode 14, iOS simulator can generate a device token, allowing us to test remote push notifications coming from a server without a real device or a need to use .apns payload files and simctl push command.
Adjust the the default appearance of the ShareLink button using SwiftUI view modifiers such as labelStyle(), imageScale() and symbolVariant().
When we add an image name to a Localizable.strings file, SwiftUI automatically uses it for the image accessibility label.
Define custom sizing logic for UIViewRepresentable views in SwiftUI apps with the new iOS 16 sizeThatFits() API.
Permanently position a view at the bottom of the screen in a SwiftUI app by placing it inside the safeAreaInset() modifier.
Make sure that all of the necessary strings are localizable in a SwiftUI app by previewing your UI in the accented pseudolanguage.
Display a self-updating date and time inside a SwiftUI Text view and prevent the UI from moving as the digits in the date change.
Set a custom background for TextEditor in SwiftUI by using a combination of scrollContentBackground() and background() view modifiers.
We can use the new Duration type from Foundation to represent an elapsed time value and format it using the new TimeFormatStyle.
To sort an array based on a particular property in Swift, we can use the KeyPathComparator API from Foundation in combination with sorted(using:) method.
Make use of the new clock APIs in Swift 5.7 to delay an async task by a certain duration without calling the old method that accepts nanoseconds.
Learn how to change the default position of y-axis in Swift Charts by using chartYAxis() modifier.
The default alignment of SwiftUI List row separators has changed in iOS 16. We also have some new APIs to customize separator insets.
Tap gesture in SwiftUI now provides the tap location and we can request it in local or global coordinate space.
Starting from iOS 16 and macOS 13 SwiftUI List view can automatically generate move and delete operations without the need of onDelete() and onMove() closures.
With enhanced text modifiers in iOS 16 and macOS 13, it's easy to animate changes to text styles such as font size and weight.
Draw a custom SwiftUI view to replace the symbols in a scatter plot in Swift Charts.
Present a half-sheet in SwiftUI by specifying supported detents with the new presentationDetents() modifier in iOS 16.
Set custom background for a navigation bar in iOS 16 using new SwiftUI toolbarBackground() modifier.
Trigger actions with onChange() modifier in SwiftUI that depend on multiple properties changing by combining the logic in a computed property.
Make use of ControlActiveState value in the environment to customize the appearance of key window on macOS in SwiftUI.
Explore different ways to iterate over items and indices in a collection and learn why enumerated() is not a good fit for it.
Learn how to size and scale symbol images in SwiftUI and why we shouldn't use resizable() modifier with SF Symbols.
Hide and show a view based on a setting or state without shifting the layout by using opacity() modifier in SwiftUI.
We have several ways to customize the visual style of links placed inside Text views in SwiftUI: tint() modifier, different Text modifiers and attributes in AttributedString.
SwiftUI Text views can automatically parse Markdown strings when created with LocalizedStringKey. Markdown isn't parsed when created with a String variable or with verbatim initializer.
Customize actions for links inside Text views in SwiftUI by using openURL environment value.
Set underline and strikethrough styles in AttributedString and display it with SwiftUI Text view.
Allow users to select the contents of SwiftUI Text view, to be able to copy or share it, by applying textSelection() modifier.
Make use of Xcode shortcuts to correct code indentation quickly.
Define your own operator that lets you use String as default value for any Optional type in debug prints.
Provide state restoration for expanded rows in a SwiftUI List view with SceneStorage property wrapper.