Declaration
import { EmptyView } from 'swiftui-react-native';@frozen nonisolated struct EmptyViewInitializers
One SwiftUI initializer backs <EmptyView>.
<EmptyView />nonisolated init()Takes no props.
Also takes the common view props: modifiers, style and testID.
Overview
You will rarely, if ever, need to create an EmptyView directly. Instead,
EmptyView represents the absence of a view.
SwiftUI uses EmptyView in situations where a SwiftUI view type defines one
or more child views with generic parameters, and allows the child views to
be absent. When absent, the child view's type in the generic type parameter
is EmptyView.
The following example creates an indeterminate ProgressView without
a label. The ProgressView type declares two generic parameters,
Label and CurrentValueLabel, for the types used by its subviews.
When both subviews are absent, like they are here, the resulting type is
ProgressView<EmptyView, EmptyView>, as indicated by the example's output:
let progressView = ProgressView()
print("\(type(of:progressView))")
// Prints: ProgressView<EmptyView, EmptyView>From Apple’s SwiftUI documentation. Code samples there are Swift.
Relationships
Conforms to
- Commands
- CustomizableToolbarContent
- SceneAccessoryContent
- Swift.BitwiseCopyable
- Swift.Copyable
- Swift.Escapable
- Swift.Sendable
- Swift.SendableMetatype
- ToolbarContent
- View
See also
More in Views.
- ArrangementViewA view that arranges primary and secondary content using an adaptive layout that responds to the environment.
- ControlGroupA container view that displays semantically-related controls in a visually-appropriate manner for the context
- DividerA visual element that can be used to separate other content.
- EditButtonA button that toggles the edit mode environment value.
- GaugeA view that shows a value within a range.
- GroupA type that collects multiple instances of a content type --- like views, scenes, or commands --- into a single unit.
- GroupBoxA stylized view, with an optional label, that visually collects a logical grouping of content.
- RenameButtonA button that triggers a standard rename action.
- SwipeActionsSwipe actions of a list row (SwiftUI swipeActions(edge:allowsFullSwipe:content:)). Place it inside a List.
- TimelineViewA view that updates according to a schedule that you provide.
- ViewThatFitsA view that adapts to the available space by providing the first child view that fits.