From bf0af35b91f4e4482c560591b6268e2744c4d771 Mon Sep 17 00:00:00 2001 From: Ondrej Rafaj Date: Fri, 27 Apr 2018 15:54:54 +0100 Subject: [PATCH] more convenience changes --- Presentables.podspec | 2 +- .../PresentableCollectionViewDataManager.swift | 8 ++++---- Presentables/Classes/Libs/PresentableSection.swift | 4 ++++ .../Table views/PresentableTableViewDataManager.swift | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Presentables.podspec b/Presentables.podspec index 50e74fa..e446166 100644 --- a/Presentables.podspec +++ b/Presentables.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'Presentables' - s.version = '0.6.4' + s.version = '0.6.5' s.summary = 'Simple reactive library for managing table views & collection views, written in Swift' # This description is used to generate tags and improve search results. diff --git a/Presentables/Classes/Collection views/PresentableCollectionViewDataManager.swift b/Presentables/Classes/Collection views/PresentableCollectionViewDataManager.swift index a8da2a0..a423dfc 100644 --- a/Presentables/Classes/Collection views/PresentableCollectionViewDataManager.swift +++ b/Presentables/Classes/Collection views/PresentableCollectionViewDataManager.swift @@ -29,20 +29,20 @@ open class PresentableCollectionViewDataManager: NSObject, PresentableManager, U } } - var collectionView: UICollectionView? + public var collectionView: UICollectionView? // MARK: Actions - public func reloadData() { + open func reloadData() { collectionView?.collectionViewLayout.invalidateLayout() collectionView?.reloadData() } - public func reload(section: Int) { + open func reload(section: Int) { collectionView?.reloadSections([section]) } - public func reload(indexPath: IndexPath) { + open func reload(indexPath: IndexPath) { collectionView?.reloadItems(at: [indexPath]) } diff --git a/Presentables/Classes/Libs/PresentableSection.swift b/Presentables/Classes/Libs/PresentableSection.swift index ae6d0b1..3ae060d 100644 --- a/Presentables/Classes/Libs/PresentableSection.swift +++ b/Presentables/Classes/Libs/PresentableSection.swift @@ -110,6 +110,10 @@ public class PresentableSection: PresentableSectionMarker, Collection { _presentables.append(presentable) } + public func append(contentsOf presentables: [PresentableType]) { + _presentables.append(contentsOf: presentables) + } + public func removeAll() { _presentables.removeAll() } diff --git a/Presentables/Classes/Table views/PresentableTableViewDataManager.swift b/Presentables/Classes/Table views/PresentableTableViewDataManager.swift index e34c4ab..46b0860 100644 --- a/Presentables/Classes/Table views/PresentableTableViewDataManager.swift +++ b/Presentables/Classes/Table views/PresentableTableViewDataManager.swift @@ -28,7 +28,7 @@ open class PresentableTableViewDataManager: NSObject, PresentableManager, UITabl } } - var tableView: UITableView? + public var tableView: UITableView? // MARK: Actions