Empty ListView for empty state
  • July 22, 2025

EmptyList – List(SwiftUI) supports displaying Empty ListView for empty state

Usage


EmptyList(countries, listRowView: { country in
Text(country.name)
}, emptyListView: {
Text(“No countries”) // View displayed when the items collection isEmpty
})

// Source data for List. Source item must implement Identifiable protocol
struct Country: Identifiable {
let id: UUID
let name: String
}

// Source data items for List
let countries: [Country] = [
Country(id: UUID(), name: “Poland”),
Country(id: UUID(), name: “Germany”)
/// Others countries
]

Example


 

Look here if need more details

Requirements


 

  • Xcode 11+
  • Swift 5.2+

And same requirements how to use SwiftUI. Availability:

  • iOS 13.0+
  • macOS 10.15+
  • Mac Catalyst 13.0+
  • tvOS 13.0+
  • watchOS 6.0+

Installation


 

Feel free copy-paste EmptyList to your project or can install via CocoaPods. For installation through CocoaPods add the following line to your Podfile:

pod ‘EmptyList’, ‘~> 1.0.0’

GitHub


View Github

#tableview
YOU MIGHT ALSO LIKE...
MijickPopups Hero

  Popups Alerts Resizable Sheets Banners

SwiftUI Tooltip

This package provides you with an easy way to show tooltips over any SwiftUI view, since Apple does not provide ...

SimpleToast for SwiftUI

SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or ...

SSToastMessage

Create Toast Views with Minimal Effort in SwiftUI Using SSToastMessage. SSToastMessage enables you to effortlessly add toast notifications, alerts, and ...

ToastUI

A simple way to show toast in SwiftUI   Getting Started • Documentation • Change Log