列表占位符 1.5

列表占位符 1.5

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2021 年 5 月
SPM支持 SPM

MKSpinner 维护。



  • 作者:
  • Moayad Al kouz

列表占位符

Version License Platform

列表占位符

Facebook 新闻源风格动画

功能

列表占位符是一个 Swift 库,它允许您轻松地将 Facebook 风格的动画占位符添加到您的表格视图、集合视图或自定义视图中。

安装

推荐使用 CocoaPods

  1. 安装CocoaPods
  2. 将此仓库添加到您的 Podfile
target 'Example' do
# IMPORTANT: Make sure use_frameworks! is included at the top of the file
use_frameworks!
platform :ios, '8.0'
pod 'ListPlaceholder'
end
  1. 运行 pod install
  2. 打开 CocoaPods 创建的 .xcworkspace
  3. 完成!

手动安装

只需从这里下载 ListLoader.swift 文件到您的项目,确保您指向您的项目目标

用法

import ListPlaceholder

UITableView 使用

//to show the loader
tableView.reloadData()
tableView.showLoader()

//to hide the loader
tableView.hideLoader()

UICollectionView 使用

//to show the loader
collectionView.reloadData()
collectionView.layoutIfNeeded()
collectionView.showLoader()

//to hide the loader
collectionView.hideLoader()

UIView 使用

//to show the loader

customView.showLoader()

//to hide the loader
customView.hideLoader()

现在占位符也支持 Objective-C 语言

@import ListPlaceholder;

//to show the loader
[_customView showLoader];
//to hide the loader
[_customView hideLoader];

示例项目

查看此处的示例项目

  1. 下载它
  2. 在 Xcode 中打开 Example.xcworkspace
  3. 享受吧!

作者

Moayad Al kouz, [email protected]

许可协议

ListPlaceholder可在MIT许可下使用。更多信息请参阅LICENSE文件。