* files reorganization (#432) * fix podspec * only include swift files * Fix broken readme paths (#433) * update links * fix french link * split skeleton debug to public and internal methods (#434) * Add build phase to execute SwiftLint (#435) * update tvOS tests * Refactor Extensions folder (#436) * Reorganize SkeletonAppearance (#437) * reorganize helpers and builders folders (#438) * Refactor flow and multilines (#439) * Reorganize collections folder (#440) * reorganize collections folder * update podspec * Refactor SkeletonView facade (#441) * reorganize collections folder * update podspec * refactor skeletonview facade * fix conflict * update iOS example * fix github workflows * update tvOS example project build settings
36 lines
1.0 KiB
Swift
36 lines
1.0 KiB
Swift
//
|
|
// UIView+CollectionSkeleton.swift
|
|
// SkeletonView-iOS
|
|
//
|
|
// Created by Juanpe Catalán on 02/02/2018.
|
|
// Copyright © 2018 SkeletonView. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
extension UIView {
|
|
|
|
func addDummyDataSourceIfNeeded() {
|
|
guard let collection = self as? CollectionSkeleton,
|
|
!ProcessInfo.isRunningXCTest else { return }
|
|
_status = .on
|
|
collection.addDummyDataSource()
|
|
collection.disableUserInteraction()
|
|
}
|
|
|
|
func updateDummyDataSourceIfNeeded() {
|
|
guard let collection = self as? CollectionSkeleton,
|
|
!ProcessInfo.isRunningXCTest else { return }
|
|
collection.updateDummyDataSource()
|
|
}
|
|
|
|
func removeDummyDataSourceIfNeeded(reloadAfter reload: Bool = true) {
|
|
guard let collection = self as? CollectionSkeleton,
|
|
!ProcessInfo.isRunningXCTest else { return }
|
|
_status = .off
|
|
collection.removeDummyDataSource(reloadAfter: reload)
|
|
collection.enableUserInteraction()
|
|
}
|
|
|
|
}
|