项目作者: Toni77777

项目描述 :
EmptyList - List(SwiftUI) supports displaying Empty ListView for empty state
高级语言: Swift
项目地址: git://github.com/Toni77777/EmptyList.git
创建时间: 2020-07-10T18:37:40Z
项目社区:https://github.com/Toni77777/EmptyList

开源协议:MIT License

下载


EmptyList

Swift 5
Platforms
Version
License: MIT

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

Usage

  1. EmptyList(countries, listRowView: { country in
  2. Text(country.name)
  3. }, emptyListView: {
  4. Text("No countries") // View displayed when the items collection isEmpty
  5. })
  6. // Source data for List. Source item must implement Identifiable protocol
  7. struct Country: Identifiable {
  8. let id: UUID
  9. let name: String
  10. }
  11. // Source data items for List
  12. let countries: [Country] = [
  13. Country(id: UUID(), name: "Poland"),
  14. Country(id: UUID(), name: "Germany")
  15. /// Others countries
  16. ]

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:

  1. pod 'EmptyList', '~> 1.0.0'

License

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