Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toni77777/emptylist
EmptyList - List(SwiftUI) supports displaying Empty ListView for empty state
https://github.com/toni77777/emptylist
apple cocoapod ios list macos swift swift5 swiftui xcode xcode11
Last synced: 17 days ago
JSON representation
EmptyList - List(SwiftUI) supports displaying Empty ListView for empty state
- Host: GitHub
- URL: https://github.com/toni77777/emptylist
- Owner: Toni77777
- License: mit
- Created: 2020-07-10T18:37:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-13T11:58:38.000Z (over 4 years ago)
- Last Synced: 2024-10-09T11:39:42.101Z (28 days ago)
- Topics: apple, cocoapod, ios, list, macos, swift, swift5, swiftui, xcode, xcode11
- Language: Swift
- Homepage:
- Size: 814 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EmptyList
[![Swift 5](https://img.shields.io/badge/swift-5-orange)](https://swift.org/)
[![Platforms](https://img.shields.io/cocoapods/p/EmptyList)](https://cocoapods.org/pods/EmptyList)
[![Version](https://img.shields.io/cocoapods/v/EmptyList.svg?style=flat)](https://cocoapods.org/pods/EmptyList)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)EmptyList - List(SwiftUI) supports displaying Empty ListView for empty state
## Usage
```swift
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](https://github.com/Toni77777/EmptyList/tree/master/Demo) if need more details
## Requirements
- Xcode 11+
- Swift 5.2+And same requirements how to use [SwiftUI](https://developer.apple.com/documentation/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](https://cocoapods.org).
For installation through [CocoaPods](https://cocoapods.org) add the following line to your Podfile:```ruby
pod 'EmptyList', '~> 1.0.0'
```## License
EmptyList is available under the MIT license. See the LICENSE file for more info.