A list of everything new in SwiftUI after WWDC 2022.
- accessibilityQuickActionsEnabled - Shows quick action bar.
- renameAction - Activates standard rename action.
- menuOrder - The preferred order of items for menus.
- searchSuggestionsPlacement - The current placement of search suggestions.
- isScrollEnabled - Can or can't scroll.
- horizontalScrollIndicatorVisibility - Can or can't see horizontal scroll indicators.
- verticalScrollIndicatorVisibility - Can or can't see vertical scroll indicators.
- scrollDismissesKeyboardMode - Dismiss keyboard when scrolling, never, automatically based on context or allow user to choose.
- supportsMultipleWindows - Check if platform allows multiple windows.
- displayStoreKitMessage - Tells StoreKit to display an App Store message
- requestReview - Ask user to review your app.
- autocorrectionDisabled - Allow auto-correct or not.
- backgroundStyle - Overrides the default system background style.
- contentTransition - Method of animating the contents of views.
- contentTransitionAddsDrawingGroup - Transition with GPU-acceleration or not.
- showsWidgetLabel - Tells you if you can or can't display an accessory label.
- Guage - A view that shows a value within a range. This can be circular or straight.
- MultiDatePicker - A control for picking multiple dates.
- NavigationStack - A view that displays a root view and enables you to present additional views over the root view. To navigate, use a NavigationLink in combination with the navigationDestination modifier. You can also specify a NavigationPath to create or manage your stack of views.
- NavigationSplitView - A container that presents 2 or 3 views in columns. (sidebar, content, detail)
- RenameButton - A button that triggers a standard rename action. Used with the renameAction modifier.
- ShareLink - A view that controls a sharing presentation.
- Works in combination with the navigationDestination modifier. NavigationLinks have values and if there is a navigationDestination modifier that matches the NavigationLink's value type, then it is used and navigates to the view the navigationDestination specifies.
- You can provide a format parameter to handle conversions for number, percent, dateTime, iso8601 date format and now URL format.
- You can bind a Toggle to an array of values.
- accessibilityActions - Adds multiple accessibility actions to the view.
- accessibilityQuickAction - Adds a quick action to be shown by the system when active.
- AccessibilityQuickActionStyle - Presentation style of an accessibility quick action. (Outline, Prompt)
- backgroundStyle - Sets the specified style to render backgrounds within the view.
- tint(ShapeStyle - Sets the tint within this view.
- scrollDisabled - Disables or enables scrolling in scrollable views.
- menuOrder - The preferred order of items for menus. (Fixed, Priority)
- persistentSystemOverlays - Preferred visibility of the non-transient system views overlaying the app.
- scrollIndicators(:axes:) - Sets the visibility of scroll indicators within this view.
- widgetAccentable - Adds view and all subviews to the accented group.
- widgetLabel - Returns a text label that displays additional content outside the accessory family widget’s main SwiftUI view.
Many of the modifiers that were just for Text can now be applied to any view and all Text within will adopt the modifier.
- bold(isActive:) - Applies bold to views when isActive is true.
- fontWeight - Can now be applied to views (not just Text).
- italic(isActive:) - Applies italics to views when isActive is true.
- strikethrough(:pattern:color:) - Can now be applied to views (not just Text).
- underline(:pattern:color:) - Can now be applied to views (not just Text).
- baselineOffset - Vertical offset that can now be applied to views (not just Text).
- kerning - Spacing between characters that can now be applied to views (not just Text).
- tracking - Spacing between all characters that can now be applied to views (not just Text).
- lineLimit - Line limit can now be applied to Text AND a vertical TextField.
- autocorrectionDisabled - Used to be disableAutoCorrection on TextField. Can be applied to any view now.
- scrollDismissesKeyboard - Dismiss keyboard when scrolling, never, automatically based on context or allow user to choose.
- findNavigator(isPresented:) - Presents the find and replace interface for TextEditor views.
- findDisabled - Prevents find and replace operations in a TextEditor.
- replaceDisabled - Prevents replace operations in a TextEditor.
- navigationTitle(title:Binding) - Allows navigation title editing.
- navigationTitle(:actions:) - Configures the navigation title with associated actions and a title.
- navigationDocument - Configures the view’s document for purposes of navigaiton.
- navigationDestination - Associates a destination view with a presented data type for use within a navigation stack.
- toolbar(:in:) - Specifies the visibility of a bar managed by SwiftUI. (Place it automatically, bottom, navigation bar, tab bar or window toolbar.)
- toolbarBackground - Customize the background style.
- toolbarColorScheme - Specifies the preferred color scheme (light or dark) of a bar.
- toolbarRole - Configures the semantic role (automatic, browser, editor, navigationStack) for the content populating the toolbar.
- contextMenu(menuItems:preview:) - Adds a context menu with a preview to a view.
- gaugeStyle - Sets the style for gauges within this view. (New for iOS)
- tableStyle - Sets the style for tables within this view. (New for iOS)
- disclosureGroupStyle - Sets the style for disclosure groups within this view.
- navigationSplitViewStyle - Sets the style for navigation split views within this view.
- gridCellColumns - Tells a view that acts as a cell in a grid to span the specified number of rows.
- gridCellAnchor - Custom alignment anchor for a view that acts as a grid cell. (top, topLeading, topTrailing, bottom, etc.)
- gridCellUnsizedAxes - Asks grid layouts not to offer the view extra size in the specified axes (horizontal or vertical).
- gridColumnAlignment - Overrides the default horizontal alignment of the grid column that the view appears in.
- SpatialTapGesture - A gesture that recognizes one or more taps and reports their location.
- onTapGesture(count:coordinateSpace:perform:) - Adds a tap gesture within the specified coordinate space. The onTapGesture isn't new. But specifying the coordinate space is.
- defersSystemGestures - Sets the screen edge from which you want your gesture to take precedence over the system gesture.
- defaultFocus - Default focus is evaluated by assigning a value to a given focus state binding.
There are over a dozen new searchable modifiers that can be used now. Rather than go through them all, I think it would be better to just list out some of the new parameters:
- scope: A binding for the active scope of the search field.
- scopes: A view builder representing the scopes of the search field which will be used to populate a Picker.
- token: A view builder that creates a view given an element in tokens.
- tokens: A collection of tokens to display and edit in the search field.
- suggestedTokens: A collection of tokens to display as suggestions.
- SearchSuggestionsPlacement - A structure that defines ways in which search suggestions may be placed. (automatic, content, menu)
- presentationDetents - Sets the available detents for the enclosing sheet. (medium, large, custom, fraction, height)
- presentationDragIndicator - Sets the visibility of the drag indicator on top of a sheet.
- offerCodeRedemption - Sheet that enables users to redeem subscription offer codes.
- backgroundPreferenceValue - Reads the specified preference value from the view, using it to produce a second view that is applied as the background of the original view.
- overlayPreferenceValue - Reads the specified preference value from the view, using it to produce a second view that is applied as an overlay to the original view.
The TextField can now overflow horizontally or vertically by specifying an axis.
- findNavigator - Programmatically presents the find and replace interface for text editor views.
- findDisabled - Prevents find and replace operations in a text editor.
- replaceDisabled - Prevents replace operations in a text editor.
- system(size:weight:design:) - While the signature looks the same, the weight and design are now optional instead of required.
The Image initializer now has a new parameter called variableValue that the rendered image can use to customize its appearance. If the symbols does not support it, this has no effect.
- ImageRenderer - An object that creates images from SwiftUI views. So you can compose a SwiftUI view and then generate an image or PDF from it.
- contentTransition - Modifies the view to use a given transition as its method of animating changes to the contents of its views.