Toni77777 / EmptyList

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EmptyList

Swift 5 Platforms Version License: MIT

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'

License

EmptyList is available under the MIT license. See the LICENSE file for more info.

About

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

License:MIT License


Languages

Language:Swift 67.7%Language:Ruby 17.0%Language:Objective-C 15.3%