25 lines
893 B
Swift
25 lines
893 B
Swift
//
|
|
// SkeletonUITableViewDataSource.swift
|
|
// SkeletonView-iOS
|
|
//
|
|
// Created by Juanpe Catalán on 06/11/2017.
|
|
// Copyright © 2017 SkeletonView. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
public protocol SkeletonUITableViewDataSource: UITableViewDataSource {
|
|
func numSections(in collectionSkeletonView: UITableView) -> Int
|
|
func collectionSkeletonView(_ skeletonView: UITableView, numberOfRowsInSection section: Int) -> Int
|
|
func collectionSkeletonView(_ skeletonView: UITableView, cellIdenfierForRowAt indexPath: IndexPath) -> ReusableCellIdentifier
|
|
}
|
|
|
|
public extension SkeletonUITableViewDataSource {
|
|
|
|
func collectionSkeletonView(_ skeletonView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
|
return Int(ceil(skeletonView.frame.height/skeletonView.rowHeight))
|
|
}
|
|
|
|
func numSections(in collectionSkeletonView: UITableView) -> Int { return 1 }
|
|
}
|