NoDataView

public struct NoDataView<Content> : View where Content : View

A no data view is shown when there is no data

Usage

 /// default NoDataView
 let noDataView = NoDataView()

 /// provide your own ViewBuilder to create the no data view
 let noDataView = NoDataView {
     GeometryReader { proxy in
         VStack(alignment: .center) {
             Text("☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹")
             Text("Customized No Data View")
             Text("☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹☹")
         }
         .frame(width: proxy.size.width, height: proxy.size.height)
         .border(Color.primary, width: 1)
     }
 }

  • provide your own ViewBuilder to create the no data view

    Declaration

    Swift

    public init(@ViewBuilder content: @escaping () -> Content)
  • the view body

    Declaration

    Swift

    public var body: some View { get }

Available where Content == EmptyView

  • the default no data view

    Declaration

    Swift

    init()