From 9cca67c0f51600e21141d6718df24711fd69e89b Mon Sep 17 00:00:00 2001 From: Srdan Rasic Date: Sun, 29 Nov 2015 20:55:40 +0100 Subject: [PATCH] Handle potential table/collection view binding issue --- ReactiveUIKit.podspec | 4 ++-- ReactiveUIKit/Info.plist | 2 +- ReactiveUIKit/UICollectionView.swift | 13 ++++++++----- ReactiveUIKit/UITableView.swift | 15 +++++++++------ 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/ReactiveUIKit.podspec b/ReactiveUIKit.podspec index a79e5b6..2f3091a 100644 --- a/ReactiveUIKit.podspec +++ b/ReactiveUIKit.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "ReactiveUIKit" - s.version = "1.0.6" + s.version = "1.0.8" s.summary = "Reactive extensions for UIKit framework." s.homepage = "https://github.com/ReactiveKit/ReactiveUIKit" s.license = 'MIT' s.author = { "Srdan Rasic" => "srdan.rasic@gmail.com" } - s.source = { :git => "https://github.com/ReactiveKit/ReactiveUIKit.git", :tag => "v1.0.6" } + s.source = { :git => "https://github.com/ReactiveKit/ReactiveUIKit.git", :tag => "v1.0.8" } s.ios.deployment_target = '8.0' s.tvos.deployment_target = '9.0' diff --git a/ReactiveUIKit/Info.plist b/ReactiveUIKit/Info.plist index 61718cd..a70ac6a 100644 --- a/ReactiveUIKit/Info.plist +++ b/ReactiveUIKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0.6 + 1.0.8 CFBundleSignature ???? CFBundleVersion diff --git a/ReactiveUIKit/UICollectionView.swift b/ReactiveUIKit/UICollectionView.swift index 37cf17e..79c1ce8 100644 --- a/ReactiveUIKit/UICollectionView.swift +++ b/ReactiveUIKit/UICollectionView.swift @@ -54,7 +54,8 @@ extension ObservableCollectionType where Collection.Index == Int { public class RKCollectionViewDataSource: NSObject, UICollectionViewDataSource { - private let collection: C + private let observableCollection: C + private var sourceCollection: C.Collection private weak var collectionView: UICollectionView! private let createCell: (NSIndexPath, C.Collection, UICollectionView) -> UICollectionViewCell private weak var proxyDataSource: RKCollectionViewProxyDataSource? @@ -64,15 +65,17 @@ public class RKCollectionViewDataSource Int { - return collection.collection.count + return sourceCollection.count } @objc public func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { - return createCell(indexPath, collection.collection, collectionView) + return createCell(indexPath, sourceCollection, collectionView) } @objc public func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView { diff --git a/ReactiveUIKit/UITableView.swift b/ReactiveUIKit/UITableView.swift index 135de64..4ef3e0b 100644 --- a/ReactiveUIKit/UITableView.swift +++ b/ReactiveUIKit/UITableView.swift @@ -65,7 +65,8 @@ extension ObservableCollectionType where Collection.Index == Int { public class RKTableViewDataSource: NSObject, UITableViewDataSource { - private let collection: C + private let observableCollection: C + private var sourceCollection: C.Collection private weak var tableView: UITableView! private let createCell: (NSIndexPath, C.Collection, UITableView) -> UITableViewCell private weak var proxyDataSource: RKTableViewProxyDataSource? @@ -75,15 +76,17 @@ public class RKTableViewDataSource Int { - return collection.collection.count + return sourceCollection.count } @objc public func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { - return createCell(indexPath, collection.collection, tableView) + return createCell(indexPath, sourceCollection, tableView) } @objc public func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {