From 7af0dd38afd53ccc6104e7dde4792637907b4f79 Mon Sep 17 00:00:00 2001 From: Rafael da Silva Ferreira Date: Tue, 11 Dec 2018 17:01:23 -0200 Subject: [PATCH 01/58] Fix ReactiveX/RxSwift reference at Cartfile.resolved --- .gitmodules | 3 - .travis.yml | 2 +- Cartfile | 2 +- Cartfile.resolved | 2 +- Differentiator.podspec | 2 +- Examples/Example.xcodeproj/project.pbxproj | 326 +----------------- .../xcshareddata/xcschemes/Example.xcscheme | 2 +- .../xcschemes/ExampleUITests.xcscheme | 2 +- Examples/RxSwift | 2 +- Examples/dependencies.sh | 6 - RxDataSources.podspec | 2 +- 11 files changed, 26 insertions(+), 325 deletions(-) delete mode 100644 .gitmodules mode change 160000 => 120000 Examples/RxSwift delete mode 100755 Examples/dependencies.sh diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 64fc6885..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "Examples/RxSwift"] - path = Examples/RxSwift - url = https://github.com/ReactiveX/RxSwift.git diff --git a/.travis.yml b/.travis.yml index 52b98c41..a8294e50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ notifications: install: true env: - - BUILD="pushd Examples && ./dependencies.sh && set -o pipefail && (xcodebuild -project Example.xcodeproj -scheme ExampleUITests -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' test && xcodebuild -project Example.xcodeproj -scheme Example -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' build) | xcpretty" + - BUILD="carthage update --platform iOS && pushd Examples && set -o pipefail && (xcodebuild -project Example.xcodeproj -scheme ExampleUITests -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' test && xcodebuild -project Example.xcodeproj -scheme Example -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' build) | xcpretty" - BUILD="carthage update --platform ios && set -o pipefail && (xcodebuild -project RxDataSources.xcodeproj -scheme Tests -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' test) | xcpretty" - BUILD="gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet; pod repo update && pod lib lint RxDataSources.podspec --verbose && pod lib lint Differentiator.podspec --verbose " - BUILD="carthage update --platform iOS && carthage build --no-skip-current --platform iOS" diff --git a/Cartfile b/Cartfile index 4cb3fb31..8ca1c8e6 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "ReactiveX/RxSwift" ~> 4.0 +github "ReactiveX/RxSwift" ~> 4.4 diff --git a/Cartfile.resolved b/Cartfile.resolved index e14f0d4c..ce434dc6 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -git "/Users/kzaher/Projects/RxSwift" "4.3.0" +github "ReactiveX/RxSwift" "4.4.0" diff --git a/Differentiator.podspec b/Differentiator.podspec index 2dbe72b9..a045a990 100644 --- a/Differentiator.podspec +++ b/Differentiator.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Differentiator" - s.version = "3.1.0" + s.version = "3.2.0" s.summary = "Diff algorithm for UITableView and UICollectionView." s.description = <<-DESC Diff algorithm for UITableView and UICollectionView. diff --git a/Examples/Example.xcodeproj/project.pbxproj b/Examples/Example.xcodeproj/project.pbxproj index 4d0ee2e1..0f9cea37 100644 --- a/Examples/Example.xcodeproj/project.pbxproj +++ b/Examples/Example.xcodeproj/project.pbxproj @@ -63,6 +63,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + B6F732B321C01D3B0007F9D9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C8165ABC21891AFF00494BEF; + remoteInfo = RxAtomic; + }; C82C3C591F3B937500309AE8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C8984C511C36AF35001E4272 /* Project object */; @@ -77,41 +84,6 @@ remoteGlobalIDString = C82C3C531F3B937500309AE8; remoteInfo = Differentiator; }; - C82C3C9C1F3B93D900309AE8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C8984C511C36AF35001E4272 /* Project object */; - proxyType = 1; - remoteGlobalIDString = C87C345C1F36352600DB85FE; - remoteInfo = Dependencies; - }; - C85CB0C41F4349E6005CE91A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C8984C511C36AF35001E4272 /* Project object */; - proxyType = 1; - remoteGlobalIDString = C87C345C1F36352600DB85FE; - remoteInfo = Dependencies; - }; - C85CB0C61F434A80005CE91A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C8984C511C36AF35001E4272 /* Project object */; - proxyType = 1; - remoteGlobalIDString = C87C345C1F36352600DB85FE; - remoteInfo = Dependencies; - }; - C85CB0C81F434A83005CE91A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C8984C511C36AF35001E4272 /* Project object */; - proxyType = 1; - remoteGlobalIDString = C87C345C1F36352600DB85FE; - remoteInfo = Dependencies; - }; - C87C34601F36353300DB85FE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C8984C511C36AF35001E4272 /* Project object */; - proxyType = 1; - remoteGlobalIDString = C87C345C1F36352600DB85FE; - remoteInfo = Dependencies; - }; C87C34641F36353B00DB85FE /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C8984C511C36AF35001E4272 /* Project object */; @@ -126,27 +98,6 @@ remoteGlobalIDString = C8A56AD71AD7424700B4673B; remoteInfo = "RxSwift-iOS"; }; - C88AC716214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C88BB8711B07E5ED0064D411; - remoteInfo = "RxSwift-macOS"; - }; - C88AC718214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2EA280C1BB9B5A200880ED3; - remoteInfo = "RxSwift-tvOS"; - }; - C88AC71A214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C8F0C0021BBBFB8B001B112F; - remoteInfo = "RxSwift-watchOS"; - }; C88AC71C214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; @@ -154,27 +105,6 @@ remoteGlobalIDString = C809396D1B8A71760088E94D; remoteInfo = "RxCocoa-iOS"; }; - C88AC71E214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C80939E71B8A71840088E94D; - remoteInfo = "RxCocoa-macOS"; - }; - C88AC720214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2138C751BB9BE9800339B5C; - remoteInfo = "RxCocoa-tvOS"; - }; - C88AC722214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C8F0C04B1BBBFBB9001B112F; - remoteInfo = "RxCocoa-watchOS"; - }; C88AC724214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; @@ -182,27 +112,6 @@ remoteGlobalIDString = C8093BC71B8A71F00088E94D; remoteInfo = "RxBlocking-iOS"; }; - C88AC726214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C8093C451B8A71FC0088E94D; - remoteInfo = "RxBlocking-macOS"; - }; - C88AC728214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2EBEB811BB9B99D003A27DC; - remoteInfo = "RxBlocking-tvOS"; - }; - C88AC72A214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C8F0C0581BBBFBCE001B112F; - remoteInfo = "RxBlocking-watchOS"; - }; C88AC72C214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; @@ -210,27 +119,6 @@ remoteGlobalIDString = C88FA50C1C25C44800CCFEA4; remoteInfo = "RxTest-iOS"; }; - C88AC72E214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C88FA51D1C25C4B500CCFEA4; - remoteInfo = "RxTest-macOS"; - }; - C88AC730214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C88FA52E1C25C4C000CCFEA4; - remoteInfo = "RxTest-tvOS"; - }; - C88AC732214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C88FA53F1C25C4CC00CCFEA4; - remoteInfo = "RxTest-watchOS"; - }; C88AC734214D9BA800C1A3E5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; @@ -321,7 +209,6 @@ C81FBF611F3B9DC00094061E /* IntegerType+IdentifiableType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "IntegerType+IdentifiableType.swift"; sourceTree = ""; }; C81FBF621F3B9DC00094061E /* String+IdentifiableType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+IdentifiableType.swift"; sourceTree = ""; }; C81FBF651F3B9DF60094061E /* AnimationConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationConfiguration.swift; sourceTree = ""; }; - C82541851F363C76009F6C03 /* dependencies.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = dependencies.sh; sourceTree = ""; }; C82C3C541F3B937500309AE8 /* Differentiator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Differentiator.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C82C3C611F3B938C00309AE8 /* AnimatableSectionModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimatableSectionModel.swift; sourceTree = ""; }; C82C3C621F3B938C00309AE8 /* AnimatableSectionModelType+ItemPath.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AnimatableSectionModelType+ItemPath.swift"; sourceTree = ""; }; @@ -462,22 +349,11 @@ C88AC6FD214D9BA800C1A3E5 /* Products */ = { isa = PBXGroup; children = ( + B6F732B421C01D3B0007F9D9 /* RxAtomic.framework */, C88AC715214D9BA800C1A3E5 /* RxSwift.framework */, - C88AC717214D9BA800C1A3E5 /* RxSwift.framework */, - C88AC719214D9BA800C1A3E5 /* RxSwift.framework */, - C88AC71B214D9BA800C1A3E5 /* RxSwift.framework */, C88AC71D214D9BA800C1A3E5 /* RxCocoa.framework */, - C88AC71F214D9BA800C1A3E5 /* RxCocoa.framework */, - C88AC721214D9BA800C1A3E5 /* RxCocoa.framework */, - C88AC723214D9BA800C1A3E5 /* RxCocoa.framework */, C88AC725214D9BA800C1A3E5 /* RxBlocking.framework */, - C88AC727214D9BA800C1A3E5 /* RxBlocking.framework */, - C88AC729214D9BA800C1A3E5 /* RxBlocking.framework */, - C88AC72B214D9BA800C1A3E5 /* RxBlocking.framework */, C88AC72D214D9BA800C1A3E5 /* RxTest.framework */, - C88AC72F214D9BA800C1A3E5 /* RxTest.framework */, - C88AC731214D9BA800C1A3E5 /* RxTest.framework */, - C88AC733214D9BA800C1A3E5 /* RxTest.framework */, C88AC735214D9BA800C1A3E5 /* AllTests-iOS.xctest */, C88AC737214D9BA800C1A3E5 /* AllTests-tvOS.xctest */, C88AC739214D9BA800C1A3E5 /* AllTests-macOS.xctest */, @@ -490,7 +366,6 @@ C8984C501C36AF35001E4272 = { isa = PBXGroup; children = ( - C82541851F363C76009F6C03 /* dependencies.sh */, C85EE5461C36F1FC0090614D /* Sources */, C8984C9C1C36B6FA001E4272 /* Example */, C8984CB21C36B723001E4272 /* ExampleUITests */, @@ -584,22 +459,6 @@ }; /* End PBXHeadersBuildPhase section */ -/* Begin PBXLegacyTarget section */ - C87C345C1F36352600DB85FE /* Dependencies */ = { - isa = PBXLegacyTarget; - buildArgumentsString = "$(ACTION)"; - buildConfigurationList = C87C345D1F36352600DB85FE /* Build configuration list for PBXLegacyTarget "Dependencies" */; - buildPhases = ( - ); - buildToolPath = ./dependencies.sh; - dependencies = ( - ); - name = Dependencies; - passBuildSettingsInEnvironment = 1; - productName = Dependencies; - }; -/* End PBXLegacyTarget section */ - /* Begin PBXNativeTarget section */ C81905AD1DEA019100AE679C /* Tests */ = { isa = PBXNativeTarget; @@ -612,7 +471,6 @@ buildRules = ( ); dependencies = ( - C85CB0C51F4349E6005CE91A /* PBXTargetDependency */, ); name = Tests; productName = Tests; @@ -631,7 +489,6 @@ buildRules = ( ); dependencies = ( - C82C3C9D1F3B93D900309AE8 /* PBXTargetDependency */, ); name = Differentiator; productName = Differentiator; @@ -653,7 +510,6 @@ C88AC73F214D9BF800C1A3E5 /* PBXTargetDependency */, C88AC741214D9BF800C1A3E5 /* PBXTargetDependency */, C82C3C9B1F3B93D200309AE8 /* PBXTargetDependency */, - C87C34611F36353300DB85FE /* PBXTargetDependency */, ); name = RxDataSources; productName = RxDataSources; @@ -673,7 +529,6 @@ buildRules = ( ); dependencies = ( - C85CB0C91F434A83005CE91A /* PBXTargetDependency */, C87C34651F36353B00DB85FE /* PBXTargetDependency */, C82C3C5A1F3B937500309AE8 /* PBXTargetDependency */, ); @@ -693,7 +548,6 @@ buildRules = ( ); dependencies = ( - C85CB0C71F434A80005CE91A /* PBXTargetDependency */, C8984CB71C36B723001E4272 /* PBXTargetDependency */, ); name = ExampleUITests; @@ -708,7 +562,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0810; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = kzaher; TargetAttributes = { C81905AD1DEA019100AE679C = { @@ -720,11 +574,6 @@ CreatedOnToolsVersion = 8.3.3; ProvisioningStyle = Automatic; }; - C87C345C1F36352600DB85FE = { - CreatedOnToolsVersion = 8.3.3; - DevelopmentTeam = 783T66X79Y; - ProvisioningStyle = Automatic; - }; C8984C591C36AF35001E4272 = { CreatedOnToolsVersion = 7.2; }; @@ -761,38 +610,23 @@ C8984C9A1C36B6FA001E4272 /* Example */, C8984CB01C36B723001E4272 /* ExampleUITests */, C81905AD1DEA019100AE679C /* Tests */, - C87C345C1F36352600DB85FE /* Dependencies */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - C88AC715214D9BA800C1A3E5 /* RxSwift.framework */ = { + B6F732B421C01D3B0007F9D9 /* RxAtomic.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = RxSwift.framework; - remoteRef = C88AC714214D9BA800C1A3E5 /* PBXContainerItemProxy */; + path = RxAtomic.framework; + remoteRef = B6F732B321C01D3B0007F9D9 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - C88AC717214D9BA800C1A3E5 /* RxSwift.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxSwift.framework; - remoteRef = C88AC716214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C88AC719214D9BA800C1A3E5 /* RxSwift.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxSwift.framework; - remoteRef = C88AC718214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C88AC71B214D9BA800C1A3E5 /* RxSwift.framework */ = { + C88AC715214D9BA800C1A3E5 /* RxSwift.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = RxSwift.framework; - remoteRef = C88AC71A214D9BA800C1A3E5 /* PBXContainerItemProxy */; + remoteRef = C88AC714214D9BA800C1A3E5 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; C88AC71D214D9BA800C1A3E5 /* RxCocoa.framework */ = { @@ -802,27 +636,6 @@ remoteRef = C88AC71C214D9BA800C1A3E5 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - C88AC71F214D9BA800C1A3E5 /* RxCocoa.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxCocoa.framework; - remoteRef = C88AC71E214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C88AC721214D9BA800C1A3E5 /* RxCocoa.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxCocoa.framework; - remoteRef = C88AC720214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C88AC723214D9BA800C1A3E5 /* RxCocoa.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxCocoa.framework; - remoteRef = C88AC722214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; C88AC725214D9BA800C1A3E5 /* RxBlocking.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -830,27 +643,6 @@ remoteRef = C88AC724214D9BA800C1A3E5 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - C88AC727214D9BA800C1A3E5 /* RxBlocking.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxBlocking.framework; - remoteRef = C88AC726214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C88AC729214D9BA800C1A3E5 /* RxBlocking.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxBlocking.framework; - remoteRef = C88AC728214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C88AC72B214D9BA800C1A3E5 /* RxBlocking.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxBlocking.framework; - remoteRef = C88AC72A214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; C88AC72D214D9BA800C1A3E5 /* RxTest.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -858,27 +650,6 @@ remoteRef = C88AC72C214D9BA800C1A3E5 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - C88AC72F214D9BA800C1A3E5 /* RxTest.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxTest.framework; - remoteRef = C88AC72E214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C88AC731214D9BA800C1A3E5 /* RxTest.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxTest.framework; - remoteRef = C88AC730214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - C88AC733214D9BA800C1A3E5 /* RxTest.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxTest.framework; - remoteRef = C88AC732214D9BA800C1A3E5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; C88AC735214D9BA800C1A3E5 /* AllTests-iOS.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; @@ -1065,31 +836,6 @@ target = C82C3C531F3B937500309AE8 /* Differentiator */; targetProxy = C82C3C9A1F3B93D200309AE8 /* PBXContainerItemProxy */; }; - C82C3C9D1F3B93D900309AE8 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = C87C345C1F36352600DB85FE /* Dependencies */; - targetProxy = C82C3C9C1F3B93D900309AE8 /* PBXContainerItemProxy */; - }; - C85CB0C51F4349E6005CE91A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = C87C345C1F36352600DB85FE /* Dependencies */; - targetProxy = C85CB0C41F4349E6005CE91A /* PBXContainerItemProxy */; - }; - C85CB0C71F434A80005CE91A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = C87C345C1F36352600DB85FE /* Dependencies */; - targetProxy = C85CB0C61F434A80005CE91A /* PBXContainerItemProxy */; - }; - C85CB0C91F434A83005CE91A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = C87C345C1F36352600DB85FE /* Dependencies */; - targetProxy = C85CB0C81F434A83005CE91A /* PBXContainerItemProxy */; - }; - C87C34611F36353300DB85FE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = C87C345C1F36352600DB85FE /* Dependencies */; - targetProxy = C87C34601F36353300DB85FE /* PBXContainerItemProxy */; - }; C87C34651F36353B00DB85FE /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = C8984C591C36AF35001E4272 /* RxDataSources */; @@ -1212,37 +958,6 @@ }; name = Release; }; - C87C345E1F36352600DB85FE /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - DEBUGGING_SYMBOLS = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = 783T66X79Y; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - C87C345F1F36352600DB85FE /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = 783T66X79Y; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; C8984C601C36AF35001E4272 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1255,12 +970,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -1316,12 +1033,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -1493,15 +1212,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C87C345D1F36352600DB85FE /* Build configuration list for PBXLegacyTarget "Dependencies" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C87C345E1F36352600DB85FE /* Debug */, - C87C345F1F36352600DB85FE /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; C8984C541C36AF35001E4272 /* Build configuration list for PBXProject "Example" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Examples/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme b/Examples/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme index 73fdd3e9..e39c5c88 100644 --- a/Examples/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme +++ b/Examples/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme @@ -1,6 +1,6 @@ Date: Wed, 12 Dec 2018 04:03:35 +0900 Subject: [PATCH 02/58] Minor indentation fix (#267) --- Sources/RxDataSources/UI+SectionedViewType.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/RxDataSources/UI+SectionedViewType.swift b/Sources/RxDataSources/UI+SectionedViewType.swift index d1f89a37..b7bfd899 100644 --- a/Sources/RxDataSources/UI+SectionedViewType.swift +++ b/Sources/RxDataSources/UI+SectionedViewType.swift @@ -57,7 +57,7 @@ extension UITableView : SectionedViewType { self.reloadSections(indexSet(sections), with: animationStyle) } - public func performBatchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) { + public func performBatchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) { self.beginUpdates() _performBatchUpdates(self, changes: changes, animationConfiguration: animationConfiguration) self.endUpdates() @@ -97,7 +97,7 @@ extension UICollectionView : SectionedViewType { self.reloadSections(indexSet(sections)) } - public func performBatchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) { + public func performBatchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) { self.performBatchUpdates({ () -> Void in _performBatchUpdates(self, changes: changes, animationConfiguration: animationConfiguration) }, completion: { (completed: Bool) -> Void in From 9aaf54d37cb45f01a2868238731bd7b89b60dab7 Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 00:53:59 +0900 Subject: [PATCH 03/58] Update RxSwift dependency to 4.5.0 in Carthage --- Cartfile.resolved | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index ce434dc6..16929f19 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "ReactiveX/RxSwift" "4.4.0" +github "ReactiveX/RxSwift" "4.5.0" From 6bc25ea03b9a37d1a3bf0379e1937e8de555d00d Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 00:54:13 +0900 Subject: [PATCH 04/58] Set SWIFT_VERSION to 5.0 --- RxDataSources.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index abe2ca36..4a619ae1 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -616,7 +616,7 @@ OTHER_SWIFT_FLAGS = "-D DEBUG"; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -690,7 +690,7 @@ OTHER_SWIFT_FLAGS = ""; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; From c15952bea4f24badd108b9c086b56ee26a917432 Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 00:54:40 +0900 Subject: [PATCH 05/58] UICollectionElementKindSectionHeader -> UICollectionView.elementKindSectionHeader --- .../RxCollectionViewSectionedDataSource+Test.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/RxDataSourcesTests/RxCollectionViewSectionedDataSource+Test.swift b/Tests/RxDataSourcesTests/RxCollectionViewSectionedDataSource+Test.swift index ceae1b91..48cb646a 100644 --- a/Tests/RxDataSourcesTests/RxCollectionViewSectionedDataSource+Test.swift +++ b/Tests/RxDataSourcesTests/RxCollectionViewSectionedDataSource+Test.swift @@ -30,7 +30,7 @@ extension RxCollectionViewSectionedDataSourceTest { let returnValue = dataSource.collectionView( collectionView, - viewForSupplementaryElementOfKind: UICollectionElementKindSectionHeader, + viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionHeader, at: IndexPath(item: 0, section: 0) ) XCTAssertEqual(returnValue, sentinel) @@ -49,7 +49,7 @@ extension RxCollectionViewSectionedDataSourceTest { let returnValue = dataSource.collectionView( collectionView, - viewForSupplementaryElementOfKind: UICollectionElementKindSectionHeader, + viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionHeader, at: IndexPath(item: 0, section: 0) ) XCTAssertEqual(returnValue, sentinel) @@ -70,7 +70,7 @@ extension RxCollectionViewSectionedDataSourceTest { let returnValue = dataSource.collectionView( collectionView, - viewForSupplementaryElementOfKind: UICollectionElementKindSectionHeader, + viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionHeader, at: IndexPath(item: 0, section: 0) ) XCTAssertEqual(returnValue, sentinel) @@ -88,7 +88,7 @@ extension RxCollectionViewSectionedDataSourceTest { let returnValue = dataSource.collectionView( collectionView, - viewForSupplementaryElementOfKind: UICollectionElementKindSectionHeader, + viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionHeader, at: IndexPath(item: 0, section: 0) ) XCTAssertEqual(returnValue, sentinel) @@ -106,7 +106,7 @@ extension RxCollectionViewSectionedDataSourceTest { let returnValue = dataSource.collectionView( collectionView, - viewForSupplementaryElementOfKind: UICollectionElementKindSectionHeader, + viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionHeader, at: IndexPath(item: 0, section: 0) ) XCTAssertEqual(returnValue, sentinel) From 8a9e17a6d0e3728e9b119b8b5301b9d0e90ce8cb Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 01:13:39 +0900 Subject: [PATCH 06/58] Replace hashValue with hash(into:) to conform Hashable --- Sources/Differentiator/Diff.swift | 6 ++++-- Sources/Differentiator/ItemPath.swift | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Sources/Differentiator/Diff.swift b/Sources/Differentiator/Diff.swift index b1ff3948..2cb14fbb 100644 --- a/Sources/Differentiator/Diff.swift +++ b/Sources/Differentiator/Diff.swift @@ -128,12 +128,14 @@ public enum Diff { private struct OptimizedIdentity : Hashable { - let hashValue: Int let identity: UnsafePointer init(_ identity: UnsafePointer) { self.identity = identity - self.hashValue = identity.pointee.hashValue + } + + func hash(into hasher: inout Hasher) { + hasher.combine(self.identity.pointee.hashValue) } static func == (lhs: OptimizedIdentity, rhs: OptimizedIdentity) -> Bool { diff --git a/Sources/Differentiator/ItemPath.swift b/Sources/Differentiator/ItemPath.swift index 9551e112..0daaf710 100644 --- a/Sources/Differentiator/ItemPath.swift +++ b/Sources/Differentiator/ItemPath.swift @@ -28,8 +28,9 @@ public func == (lhs: ItemPath, rhs: ItemPath) -> Bool { extension ItemPath: Hashable { - public var hashValue: Int { - return sectionIndex.byteSwapped.hashValue ^ itemIndex.hashValue + public func hash(into hasher: inout Hasher) { + hasher.combine(sectionIndex.byteSwapped.hashValue) + hasher.combine(itemIndex.hashValue) } } From 6ab58d709382b20863d2143b73f01944b244282e Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 01:13:56 +0900 Subject: [PATCH 07/58] Update project settings to recommended --- RxDataSources.xcodeproj/project.pbxproj | 8 ++++++-- .../xcshareddata/xcschemes/Differentiator.xcscheme | 4 +--- .../xcshareddata/xcschemes/RxDataSources.xcscheme | 4 +--- .../xcshareddata/xcschemes/Tests.xcscheme | 4 +--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index 4a619ae1..a49230cf 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -331,7 +331,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0810; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = kzaher; TargetAttributes = { C81905AD1DEA019100AE679C = { @@ -350,7 +350,7 @@ }; buildConfigurationList = C8984C541C36AF35001E4272 /* Build configuration list for PBXProject "RxDataSources" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -556,12 +556,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -637,12 +639,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/RxDataSources.xcodeproj/xcshareddata/xcschemes/Differentiator.xcscheme b/RxDataSources.xcodeproj/xcshareddata/xcschemes/Differentiator.xcscheme index 2fb1b155..aff9d870 100644 --- a/RxDataSources.xcodeproj/xcshareddata/xcschemes/Differentiator.xcscheme +++ b/RxDataSources.xcodeproj/xcshareddata/xcschemes/Differentiator.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/RxDataSources.xcodeproj/xcshareddata/xcschemes/RxDataSources.xcscheme b/RxDataSources.xcodeproj/xcshareddata/xcschemes/RxDataSources.xcscheme index 012077d5..8731aaa0 100644 --- a/RxDataSources.xcodeproj/xcshareddata/xcschemes/RxDataSources.xcscheme +++ b/RxDataSources.xcodeproj/xcshareddata/xcschemes/RxDataSources.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/RxDataSources.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme b/RxDataSources.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme index 11c55065..f8081133 100644 --- a/RxDataSources.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme +++ b/RxDataSources.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme @@ -1,6 +1,6 @@ Date: Thu, 4 Apr 2019 01:14:18 +0900 Subject: [PATCH 08/58] Use Swift 5 in Package.swift --- Package.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 99be0b88..acd6e3f9 100644 --- a/Package.swift +++ b/Package.swift @@ -1,9 +1,12 @@ -// swift-tools-version:4.0 +// swift-tools-version:5.0 import PackageDescription let package = Package( name: "RxDataSources", + platforms: [ + .iOS(.v8), .tvOS(.v9) + ], products: [ .library(name: "RxDataSources", targets: ["RxDataSources"]), .library(name: "Differentiator", targets: ["Differentiator"]), @@ -15,5 +18,6 @@ let package = Package( .target(name: "RxDataSources", dependencies: ["Differentiator", "RxSwift", "RxCocoa"]), .target(name: "Differentiator"), .testTarget(name: "RxDataSourcesTests", dependencies: ["RxDataSources"]), - ] + ], + swiftLanguageVersions: [.v4_2, .v5] ) From 78e0d34cfa0cf84daf730d2044a8106f0cdbd43b Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 01:14:26 +0900 Subject: [PATCH 09/58] Bump RxSwift and RxCocoa dependency to 4.5.0 --- Package.resolved | 4 ++-- Package.swift | 2 +- RxDataSources.podspec | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Package.resolved b/Package.resolved index b77b1084..4f553d3c 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", "state": { "branch": null, - "revision": "12cccb171ad9038251af6883807f0290c1d75a5b", - "version": "4.0.0" + "revision": "cce95dd704bc08cd3d69c087a05a6fc3118e2722", + "version": "4.5.0" } } ] diff --git a/Package.swift b/Package.swift index acd6e3f9..8dd0ca38 100644 --- a/Package.swift +++ b/Package.swift @@ -12,7 +12,7 @@ let package = Package( .library(name: "Differentiator", targets: ["Differentiator"]), ], dependencies: [ - .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "4.0.0")), + .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "4.5.0")), ], targets: [ .target(name: "RxDataSources", dependencies: ["Differentiator", "RxSwift", "RxCocoa"]), diff --git a/RxDataSources.podspec b/RxDataSources.podspec index aee21517..7c22a023 100644 --- a/RxDataSources.podspec +++ b/RxDataSources.podspec @@ -37,8 +37,8 @@ data s.source_files = 'Sources/RxDataSources/**/*.swift' s.dependency 'Differentiator', '~> 3.0' - s.dependency 'RxSwift', '~> 4.0' - s.dependency 'RxCocoa', '~> 4.0' + s.dependency 'RxSwift', '~> 4.5' + s.dependency 'RxCocoa', '~> 4.5' s.ios.deployment_target = '8.0' s.tvos.deployment_target = '9.0' From 45f05609c765113a44ba2e478f6638f42aa04e57 Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 01:15:15 +0900 Subject: [PATCH 10/58] Remove .swift-version as it is deprecated --- .swift-version | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .swift-version diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 5186d070..00000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -4.0 From 97a8aa321f8721f5bd6131d158ca6f4dd864ac87 Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 01:15:21 +0900 Subject: [PATCH 11/58] Add swift_version to podspec --- Differentiator.podspec | 1 + RxDataSources.podspec | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Differentiator.podspec b/Differentiator.podspec index a045a990..3120ed9c 100644 --- a/Differentiator.podspec +++ b/Differentiator.podspec @@ -13,6 +13,7 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/RxSwiftCommunity/RxDataSources.git", :tag => s.version.to_s } s.requires_arc = true + s.swift_version = '5.0' s.source_files = 'Sources/Differentiator/**/*.swift' diff --git a/RxDataSources.podspec b/RxDataSources.podspec index 7c22a023..bc7f3b91 100644 --- a/RxDataSources.podspec +++ b/RxDataSources.podspec @@ -34,7 +34,8 @@ data s.source = { :git => "https://github.com/RxSwiftCommunity/RxDataSources.git", :tag => s.version.to_s } s.requires_arc = true - + s.swift_version = '5.0' + s.source_files = 'Sources/RxDataSources/**/*.swift' s.dependency 'Differentiator', '~> 3.0' s.dependency 'RxSwift', '~> 4.5' From d890cf89724318f0fb3d76d95e95d72e3bc239a0 Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 01:15:28 +0900 Subject: [PATCH 12/58] Use Xcode 10.2 in Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a8294e50..f4367b1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: objective-c -osx_image: xcode10 +osx_image: xcode10.2 notifications: slack: rxswift:3ykt2Z61f8GkdvhCZTYPduOL From a519ef67303680a401fd01a6bb0eff079177fc7e Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 4 Apr 2019 01:17:21 +0900 Subject: [PATCH 13/58] Update Requirements section in README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 88891b62..c714c08d 100644 --- a/README.md +++ b/README.md @@ -143,10 +143,11 @@ To use one of the two animated data sources, you must take a few extra steps on ## Requirements -Xcode 9.0 +Xcode 10.2 -Swift 4.0 +Swift 5.0 +For Swift 4.x version please use versions `3.0.0 ... 3.1.0` For Swift 3.x version please use versions `1.0 ... 2.0.2` For Swift 2.3 version please use versions `0.1 ... 0.9` From c385cbe166dec7cf2980724e43309b2feffe1aaa Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Sun, 7 Apr 2019 21:03:35 +0900 Subject: [PATCH 14/58] Memoize hashValue in Diff.swift --- Sources/Differentiator/Diff.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Differentiator/Diff.swift b/Sources/Differentiator/Diff.swift index 2cb14fbb..3e3d31d8 100644 --- a/Sources/Differentiator/Diff.swift +++ b/Sources/Differentiator/Diff.swift @@ -129,13 +129,15 @@ public enum Diff { private struct OptimizedIdentity : Hashable { let identity: UnsafePointer + private let cachedHashValue: Int init(_ identity: UnsafePointer) { self.identity = identity + self.cachedHashValue = identity.pointee.hashValue } func hash(into hasher: inout Hasher) { - hasher.combine(self.identity.pointee.hashValue) + hasher.combine(self.cachedHashValue) } static func == (lhs: OptimizedIdentity, rhs: OptimizedIdentity) -> Bool { From 5eb763b1f9db96655d54a0e36a0d5f16d4a3e784 Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Sun, 7 Apr 2019 21:04:38 +0900 Subject: [PATCH 15/58] Bump version to 4.0.0 --- RxDataSources.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RxDataSources.podspec b/RxDataSources.podspec index bc7f3b91..42865494 100644 --- a/RxDataSources.podspec +++ b/RxDataSources.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxDataSources" - s.version = "3.2.0" + s.version = "4.0.0" s.summary = "This is a collection of reactive data sources for UITableView and UICollectionView." s.description = <<-DESC This is a collection of reactive data sources for UITableView and UICollectionView. From 16893253542dad761b34a237ab149a4df6d6036f Mon Sep 17 00:00:00 2001 From: Alex Shubin Date: Fri, 2 Nov 2018 22:53:02 +0300 Subject: [PATCH 16/58] SectionModel made equatable when its model and items conforms to equatable. --- CHANGELOG.md | 1 + Sources/Differentiator/SectionModel.swift | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05d774b4..43acbd8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. #### Enhancements * Reduce computational complexity. #242 * Adapted for RxSwift 4.2 +* SectionModel made equatable when its model and items conforms to equatable. ## [3.1.0](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/3.1.0) diff --git a/Sources/Differentiator/SectionModel.swift b/Sources/Differentiator/SectionModel.swift index 1367c2a8..7febbbc6 100644 --- a/Sources/Differentiator/SectionModel.swift +++ b/Sources/Differentiator/SectionModel.swift @@ -36,6 +36,9 @@ extension SectionModel } } +extension SectionModel + : Equatable where Section: Equatable, ItemType: Equatable {} + extension SectionModel { public init(original: SectionModel, items: [Item]) { self.model = original.model From 521ebad96b2a885bf00128eec14d343dcc8a76d7 Mon Sep 17 00:00:00 2001 From: Alex Shubin Date: Sat, 3 Nov 2018 01:15:11 +0300 Subject: [PATCH 17/58] syntax error --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43acbd8f..ebf77ae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file. #### Enhancements * Reduce computational complexity. #242 * Adapted for RxSwift 4.2 -* SectionModel made equatable when its model and items conforms to equatable. +* Makes SectionModel equatable when its model and items conforms to equatable. ## [3.1.0](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/3.1.0) From d3e565121946d3514e228eccafa9548f885b6eb9 Mon Sep 17 00:00:00 2001 From: Alex Shubin Date: Sat, 3 Nov 2018 18:50:37 +0300 Subject: [PATCH 18/58] swift 4.1 support --- Sources/Differentiator/SectionModel.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/Differentiator/SectionModel.swift b/Sources/Differentiator/SectionModel.swift index 7febbbc6..4a3a3dab 100644 --- a/Sources/Differentiator/SectionModel.swift +++ b/Sources/Differentiator/SectionModel.swift @@ -37,7 +37,12 @@ extension SectionModel } extension SectionModel - : Equatable where Section: Equatable, ItemType: Equatable {} + : Equatable where Section: Equatable, ItemType: Equatable { + public static func == (lhs: SectionModel, rhs: SectionModel) -> Bool { + return lhs.model == rhs.model + && lhs.items == rhs.items + } +} extension SectionModel { public init(original: SectionModel, items: [Item]) { From 3d27d257960b362a663b3cd83017d66503e967bc Mon Sep 17 00:00:00 2001 From: Alex Shubin Date: Wed, 26 Dec 2018 15:02:57 +0300 Subject: [PATCH 19/58] swift derictives --- Sources/Differentiator/SectionModel.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Differentiator/SectionModel.swift b/Sources/Differentiator/SectionModel.swift index 4a3a3dab..a7835d84 100644 --- a/Sources/Differentiator/SectionModel.swift +++ b/Sources/Differentiator/SectionModel.swift @@ -36,6 +36,7 @@ extension SectionModel } } +#if swift(>=4.1) extension SectionModel : Equatable where Section: Equatable, ItemType: Equatable { public static func == (lhs: SectionModel, rhs: SectionModel) -> Bool { @@ -43,6 +44,7 @@ extension SectionModel && lhs.items == rhs.items } } +#endif extension SectionModel { public init(original: SectionModel, items: [Item]) { From 153d78838c4655725d6d916b63243e159c5367e7 Mon Sep 17 00:00:00 2001 From: Alex Shubin Date: Thu, 27 Dec 2018 08:38:49 +0300 Subject: [PATCH 20/58] equatable AnimatableSectionModel --- CHANGELOG.md | 2 +- .../Differentiator/AnimatableSectionModel.swift | 11 +++++++++++ Sources/Differentiator/SectionModel.swift | 15 ++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebf77ae2..3fac0f99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file. #### Enhancements * Reduce computational complexity. #242 * Adapted for RxSwift 4.2 -* Makes SectionModel equatable when its model and items conforms to equatable. +* Makes SectionModel and AnimatableSectionModel equatable when their model and items conforms to equatable. ## [3.1.0](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/3.1.0) diff --git a/Sources/Differentiator/AnimatableSectionModel.swift b/Sources/Differentiator/AnimatableSectionModel.swift index 8141a622..f5683b37 100644 --- a/Sources/Differentiator/AnimatableSectionModel.swift +++ b/Sources/Differentiator/AnimatableSectionModel.swift @@ -47,3 +47,14 @@ extension AnimatableSectionModel } } + +#if swift(>=4.1) +extension AnimatableSectionModel + : Equatable where Section: Equatable { + + public static func == (lhs: AnimatableSectionModel, rhs: AnimatableSectionModel) -> Bool { + return lhs.model == rhs.model + && lhs.items == rhs.items + } +} +#endif diff --git a/Sources/Differentiator/SectionModel.swift b/Sources/Differentiator/SectionModel.swift index a7835d84..28e6f8a1 100644 --- a/Sources/Differentiator/SectionModel.swift +++ b/Sources/Differentiator/SectionModel.swift @@ -36,19 +36,20 @@ extension SectionModel } } +extension SectionModel { + public init(original: SectionModel, items: [Item]) { + self.model = original.model + self.items = items + } +} + #if swift(>=4.1) extension SectionModel : Equatable where Section: Equatable, ItemType: Equatable { + public static func == (lhs: SectionModel, rhs: SectionModel) -> Bool { return lhs.model == rhs.model && lhs.items == rhs.items } } #endif - -extension SectionModel { - public init(original: SectionModel, items: [Item]) { - self.model = original.model - self.items = items - } -} From e0af2d1f6c90dd03a04bf10693610ab46b3f9a39 Mon Sep 17 00:00:00 2001 From: Mikhail Markin Date: Sun, 7 Apr 2019 14:14:16 +0300 Subject: [PATCH 21/58] Crash resolved by setting sections within updateBlock. --- CHANGELOG.md | 1 + ...ctionViewSectionedAnimatedDataSource.swift | 104 +++++++----------- ...TableViewSectionedAnimatedDataSource.swift | 18 ++- .../RxDataSources/UI+SectionedViewType.swift | 73 +++++------- 4 files changed, 84 insertions(+), 112 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fac0f99..381c5d18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. * Reduce computational complexity. #242 * Adapted for RxSwift 4.2 * Makes SectionModel and AnimatableSectionModel equatable when their model and items conforms to equatable. +* Resolved issues with Animated Collection View #60 ## [3.1.0](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/3.1.0) diff --git a/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift b/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift index d3fa7076..63b4814c 100644 --- a/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift +++ b/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift @@ -15,10 +15,6 @@ import RxCocoa #endif import Differentiator -/* - This is commented becuse collection view has bugs when doing animated updates. - Take a look at randomized sections. -*/ open class RxCollectionViewSectionedAnimatedDataSource : CollectionViewSectionedDataSource , RxCollectionViewDataSourceType { @@ -47,69 +43,12 @@ open class RxCollectionViewSectionedAnimatedDataSource)>() - - /** - This method exists because collection view updates are throttled because of internal collection view bugs. - Collection view behaves poorly during fast updates, so this should remedy those issues. - */ - open func collectionView(_ collectionView: UICollectionView, throttledObservedEvent event: Event) { - Binder(self) { dataSource, newSections in - let oldSections = dataSource.sectionModels - do { - // if view is not in view hierarchy, performing batch updates will crash the app - if collectionView.window == nil { - dataSource.setSections(newSections) - collectionView.reloadData() - return - } - let differences = try Diff.differencesForSectionedView(initialSections: oldSections, finalSections: newSections) - - switch self.decideViewTransition(self, collectionView, differences) { - case .animated: - for difference in differences { - dataSource.setSections(difference.finalSections) - - collectionView.performBatchUpdates(difference, animationConfiguration: self.animationConfiguration) - } - case .reload: - self.setSections(newSections) - collectionView.reloadData() - } - } - catch let e { - #if DEBUG - print("Error while binding data animated: \(e)\nFallback to normal `reloadData` behavior.") - rxDebugFatalError(e) - #endif - self.setSections(newSections) - collectionView.reloadData() - } - }.on(event) - } - open func collectionView(_ collectionView: UICollectionView, observedEvent: Event) { Binder(self) { dataSource, newSections in #if DEBUG @@ -121,8 +60,41 @@ open class RxCollectionViewSectionedAnimatedDataSource switch self.decideViewTransition(self, tableView, differences) { case .animated: + // each difference must be run in a separate performBatchUpdate, otherwise it crashes. + // this is a limitation of Diff tool for difference in differences { - dataSource.setSections(difference.finalSections) - - tableView.performBatchUpdates(difference, animationConfiguration: self.animationConfiguration) + let updateBlock = { [unowned self] in + // sections must be set within updateBlock in performBatchUpdates + dataSource.setSections(difference.finalSections) + tableView.batchUpdates(difference, animationConfiguration: self.animationConfiguration) + } + if #available(iOS 11, *) { + tableView.performBatchUpdates(updateBlock, completion: nil) + } else { + tableView.beginUpdates() + updateBlock() + tableView.endUpdates() + } } + case .reload: self.setSections(newSections) tableView.reloadData() diff --git a/Sources/RxDataSources/UI+SectionedViewType.swift b/Sources/RxDataSources/UI+SectionedViewType.swift index b7bfd899..c9511067 100644 --- a/Sources/RxDataSources/UI+SectionedViewType.swift +++ b/Sources/RxDataSources/UI+SectionedViewType.swift @@ -56,12 +56,6 @@ extension UITableView : SectionedViewType { public func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) { self.reloadSections(indexSet(sections), with: animationStyle) } - - public func performBatchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) { - self.beginUpdates() - _performBatchUpdates(self, changes: changes, animationConfiguration: animationConfiguration) - self.endUpdates() - } } extension UICollectionView : SectionedViewType { @@ -96,13 +90,6 @@ extension UICollectionView : SectionedViewType { public func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) { self.reloadSections(indexSet(sections)) } - - public func performBatchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) { - self.performBatchUpdates({ () -> Void in - _performBatchUpdates(self, changes: changes, animationConfiguration: animationConfiguration) - }, completion: { (completed: Bool) -> Void in - }) - } } public protocol SectionedViewType { @@ -116,39 +103,39 @@ public protocol SectionedViewType { func moveSection(_ from: Int, to: Int) func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) - func performBatchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) + func batchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) } -func _performBatchUpdates(_ view: V, changes: Changeset, animationConfiguration:AnimationConfiguration) { - typealias I = S.Item - - view.deleteSections(changes.deletedSections, animationStyle: animationConfiguration.deleteAnimation) - // Updated sections doesn't mean reload entire section, somebody needs to update the section view manually - // otherwise all cells will be reloaded for nothing. - //view.reloadSections(changes.updatedSections, animationStyle: rowAnimation) - view.insertSections(changes.insertedSections, animationStyle: animationConfiguration.insertAnimation) - for (from, to) in changes.movedSections { - view.moveSection(from, to: to) - } - - view.deleteItemsAtIndexPaths( - changes.deletedItems.map { IndexPath(item: $0.itemIndex, section: $0.sectionIndex) }, - animationStyle: animationConfiguration.deleteAnimation - ) - view.insertItemsAtIndexPaths( - changes.insertedItems.map { IndexPath(item: $0.itemIndex, section: $0.sectionIndex) }, - animationStyle: animationConfiguration.insertAnimation - ) - view.reloadItemsAtIndexPaths( - changes.updatedItems.map { IndexPath(item: $0.itemIndex, section: $0.sectionIndex) }, - animationStyle: animationConfiguration.reloadAnimation - ) - - for (from, to) in changes.movedItems { - view.moveItemAtIndexPath( - IndexPath(item: from.itemIndex, section: from.sectionIndex), - to: IndexPath(item: to.itemIndex, section: to.sectionIndex) +extension SectionedViewType { + public func batchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) { + typealias I = S.Item + + deleteSections(changes.deletedSections, animationStyle: animationConfiguration.deleteAnimation) + + insertSections(changes.insertedSections, animationStyle: animationConfiguration.insertAnimation) + for (from, to) in changes.movedSections { + moveSection(from, to: to) + } + + deleteItemsAtIndexPaths( + changes.deletedItems.map { IndexPath(item: $0.itemIndex, section: $0.sectionIndex) }, + animationStyle: animationConfiguration.deleteAnimation + ) + insertItemsAtIndexPaths( + changes.insertedItems.map { IndexPath(item: $0.itemIndex, section: $0.sectionIndex) }, + animationStyle: animationConfiguration.insertAnimation + ) + reloadItemsAtIndexPaths( + changes.updatedItems.map { IndexPath(item: $0.itemIndex, section: $0.sectionIndex) }, + animationStyle: animationConfiguration.reloadAnimation ) + + for (from, to) in changes.movedItems { + moveItemAtIndexPath( + IndexPath(item: from.itemIndex, section: from.sectionIndex), + to: IndexPath(item: to.itemIndex, section: to.sectionIndex) + ) + } } } #endif From 812f7b443379cbfe7a6de70fe4306dcd494c2492 Mon Sep 17 00:00:00 2001 From: Mikhail Markin Date: Tue, 9 Apr 2019 16:20:38 +0300 Subject: [PATCH 22/58] .swift-version file removed. Minor comments update. --- .../RxCollectionViewSectionedAnimatedDataSource.swift | 4 ++-- .../RxTableViewSectionedAnimatedDataSource.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift b/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift index 63b4814c..227798ba 100644 --- a/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift +++ b/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift @@ -73,11 +73,11 @@ open class RxCollectionViewSectionedAnimatedDataSource switch self.decideViewTransition(self, tableView, differences) { case .animated: - // each difference must be run in a separate performBatchUpdate, otherwise it crashes. + // each difference must be run in a separate 'performBatchUpdates', otherwise it crashes. // this is a limitation of Diff tool for difference in differences { let updateBlock = { [unowned self] in - // sections must be set within updateBlock in performBatchUpdates + // sections must be set within updateBlock in 'performBatchUpdates' dataSource.setSections(difference.finalSections) tableView.batchUpdates(difference, animationConfiguration: self.animationConfiguration) } From ad0690dcea75e791b7cca7b72f09514f72430032 Mon Sep 17 00:00:00 2001 From: Mikhail Markin Date: Tue, 9 Apr 2019 17:05:05 +0300 Subject: [PATCH 23/58] #available tvOS 11 added for UITableView.performBatchUpdates(_:completion:) --- .../RxDataSources/RxTableViewSectionedAnimatedDataSource.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift b/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift index 5de6d582..b9bbd205 100644 --- a/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift +++ b/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift @@ -107,7 +107,7 @@ open class RxTableViewSectionedAnimatedDataSource dataSource.setSections(difference.finalSections) tableView.batchUpdates(difference, animationConfiguration: self.animationConfiguration) } - if #available(iOS 11, *) { + if #available(iOS 11, tvOS 11, *) { tableView.performBatchUpdates(updateBlock, completion: nil) } else { tableView.beginUpdates() From bf7aaeb49f65ef43e9c5c78ccb1a05871f9a7e9d Mon Sep 17 00:00:00 2001 From: Mikhail Markin Date: Wed, 10 Apr 2019 16:34:05 +0300 Subject: [PATCH 24/58] DispatchQueue.main.async removed for RxCollectionViewSectionedAnimatedDataSource and RxTableViewSectionedAnimatedDataSource. batchUpdates(_:animationConfiguration:) removed from SectionedViewType protocol interface. self replaced with dataSource for tableView(_:observeEvent:) and collectionView(_:observeEvent:). indentation fixed. --- ...ctionViewSectionedAnimatedDataSource.swift | 65 ++++++++-------- ...lectionViewSectionedReloadDataSource.swift | 2 +- ...TableViewSectionedAnimatedDataSource.swift | 78 +++++++++---------- ...RxTableViewSectionedReloadDataSource.swift | 2 +- .../RxDataSources/UI+SectionedViewType.swift | 2 - 5 files changed, 72 insertions(+), 77 deletions(-) diff --git a/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift b/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift index 227798ba..7e5b9d63 100644 --- a/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift +++ b/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift @@ -52,49 +52,48 @@ open class RxCollectionViewSectionedAnimatedDataSource) { Binder(self) { dataSource, newSections in #if DEBUG - self._dataSourceBound = true + dataSource._dataSourceBound = true #endif - if !self.dataSet { - self.dataSet = true + if !dataSource.dataSet { + dataSource.dataSet = true dataSource.setSections(newSections) collectionView.reloadData() } else { - DispatchQueue.main.async { - // if view is not in view hierarchy, performing batch updates will crash the app - if collectionView.window == nil { - dataSource.setSections(newSections) - collectionView.reloadData() - return - } - let oldSections = dataSource.sectionModels - do { - let differences = try Diff.differencesForSectionedView(initialSections: oldSections, finalSections: newSections) - - switch self.decideViewTransition(self, collectionView, differences) { - case .animated: - // each difference must be run in a separate 'performBatchUpdates', otherwise it crashes. - // this is a limitation of Diff tool - for difference in differences { - collectionView.performBatchUpdates({ [unowned self] in - // sections must be set within updateBlock in 'performBatchUpdates' - dataSource.setSections(difference.finalSections) - collectionView.batchUpdates(difference, animationConfiguration: self.animationConfiguration) - }, completion: nil) + // if view is not in view hierarchy, performing batch updates will crash the app + if collectionView.window == nil { + dataSource.setSections(newSections) + collectionView.reloadData() + return + } + let oldSections = dataSource.sectionModels + do { + let differences = try Diff.differencesForSectionedView(initialSections: oldSections, finalSections: newSections) + + switch dataSource.decideViewTransition(dataSource, collectionView, differences) { + case .animated: + // each difference must be run in a separate 'performBatchUpdates', otherwise it crashes. + // this is a limitation of Diff tool + for difference in differences { + let updateBlock = { + // sections must be set within updateBlock in 'performBatchUpdates' + dataSource.setSections(difference.finalSections) + collectionView.batchUpdates(difference, animationConfiguration: dataSource.animationConfiguration) } - - case .reload: - self.setSections(newSections) - collectionView.reloadData() - return + collectionView.performBatchUpdates(updateBlock, completion: nil) } - } - catch let e { - rxDebugFatalError(e) - self.setSections(newSections) + + case .reload: + dataSource.setSections(newSections) collectionView.reloadData() + return } } + catch let e { + rxDebugFatalError(e) + dataSource.setSections(newSections) + collectionView.reloadData() + } } }.on(observedEvent) } diff --git a/Sources/RxDataSources/RxCollectionViewSectionedReloadDataSource.swift b/Sources/RxDataSources/RxCollectionViewSectionedReloadDataSource.swift index 08b37b6b..a5bbc7b8 100644 --- a/Sources/RxDataSources/RxCollectionViewSectionedReloadDataSource.swift +++ b/Sources/RxDataSources/RxCollectionViewSectionedReloadDataSource.swift @@ -24,7 +24,7 @@ open class RxCollectionViewSectionedReloadDataSource open func collectionView(_ collectionView: UICollectionView, observedEvent: Event) { Binder(self) { dataSource, element in #if DEBUG - self._dataSourceBound = true + dataSource._dataSourceBound = true #endif dataSource.setSections(element) collectionView.reloadData() diff --git a/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift b/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift index b9bbd205..23d6fb6f 100644 --- a/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift +++ b/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift @@ -78,56 +78,54 @@ open class RxTableViewSectionedAnimatedDataSource open func tableView(_ tableView: UITableView, observedEvent: Event) { Binder(self) { dataSource, newSections in #if DEBUG - self._dataSourceBound = true + dataSource._dataSourceBound = true #endif - if !self.dataSet { - self.dataSet = true + if !dataSource.dataSet { + dataSource.dataSet = true dataSource.setSections(newSections) tableView.reloadData() } else { - DispatchQueue.main.async { - // if view is not in view hierarchy, performing batch updates will crash the app - if tableView.window == nil { - dataSource.setSections(newSections) - tableView.reloadData() - return - } - let oldSections = dataSource.sectionModels - do { - let differences = try Diff.differencesForSectionedView(initialSections: oldSections, finalSections: newSections) - - switch self.decideViewTransition(self, tableView, differences) { - case .animated: - // each difference must be run in a separate 'performBatchUpdates', otherwise it crashes. - // this is a limitation of Diff tool - for difference in differences { - let updateBlock = { [unowned self] in - // sections must be set within updateBlock in 'performBatchUpdates' - dataSource.setSections(difference.finalSections) - tableView.batchUpdates(difference, animationConfiguration: self.animationConfiguration) - } - if #available(iOS 11, tvOS 11, *) { - tableView.performBatchUpdates(updateBlock, completion: nil) - } else { - tableView.beginUpdates() - updateBlock() - tableView.endUpdates() - } + // if view is not in view hierarchy, performing batch updates will crash the app + if tableView.window == nil { + dataSource.setSections(newSections) + tableView.reloadData() + return + } + let oldSections = dataSource.sectionModels + do { + let differences = try Diff.differencesForSectionedView(initialSections: oldSections, finalSections: newSections) + + switch dataSource.decideViewTransition(dataSource, tableView, differences) { + case .animated: + // each difference must be run in a separate 'performBatchUpdates', otherwise it crashes. + // this is a limitation of Diff tool + for difference in differences { + let updateBlock = { + // sections must be set within updateBlock in 'performBatchUpdates' + dataSource.setSections(difference.finalSections) + tableView.batchUpdates(difference, animationConfiguration: dataSource.animationConfiguration) + } + if #available(iOS 11, tvOS 11, *) { + tableView.performBatchUpdates(updateBlock, completion: nil) + } else { + tableView.beginUpdates() + updateBlock() + tableView.endUpdates() } - - case .reload: - self.setSections(newSections) - tableView.reloadData() - return } - } - catch let e { - rxDebugFatalError(e) - self.setSections(newSections) + + case .reload: + dataSource.setSections(newSections) tableView.reloadData() + return } } + catch let e { + rxDebugFatalError(e) + dataSource.setSections(newSections) + tableView.reloadData() + } } }.on(observedEvent) } diff --git a/Sources/RxDataSources/RxTableViewSectionedReloadDataSource.swift b/Sources/RxDataSources/RxTableViewSectionedReloadDataSource.swift index 26629ce7..f1365d2c 100644 --- a/Sources/RxDataSources/RxTableViewSectionedReloadDataSource.swift +++ b/Sources/RxDataSources/RxTableViewSectionedReloadDataSource.swift @@ -23,7 +23,7 @@ open class RxTableViewSectionedReloadDataSource open func tableView(_ tableView: UITableView, observedEvent: Event) { Binder(self) { dataSource, element in #if DEBUG - self._dataSourceBound = true + dataSource._dataSourceBound = true #endif dataSource.setSections(element) tableView.reloadData() diff --git a/Sources/RxDataSources/UI+SectionedViewType.swift b/Sources/RxDataSources/UI+SectionedViewType.swift index c9511067..065fe975 100644 --- a/Sources/RxDataSources/UI+SectionedViewType.swift +++ b/Sources/RxDataSources/UI+SectionedViewType.swift @@ -102,8 +102,6 @@ public protocol SectionedViewType { func deleteSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) func moveSection(_ from: Int, to: Int) func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) - - func batchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) } extension SectionedViewType { From 6bc40da7fb05ea8229d21f12727748f8e0c63527 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Sun, 21 Apr 2019 13:24:57 +0200 Subject: [PATCH 25/58] Changes to MACH-O static library. --- Examples/Example.xcodeproj/project.pbxproj | 184 ++++++++++++++++++++- RxDataSources.xcodeproj/project.pbxproj | 4 + 2 files changed, 181 insertions(+), 7 deletions(-) diff --git a/Examples/Example.xcodeproj/project.pbxproj b/Examples/Example.xcodeproj/project.pbxproj index 0f9cea37..b1ce924a 100644 --- a/Examples/Example.xcodeproj/project.pbxproj +++ b/Examples/Example.xcodeproj/project.pbxproj @@ -63,12 +63,89 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - B6F732B321C01D3B0007F9D9 /* PBXContainerItemProxy */ = { + 1E88A64F226C8A81007B9436 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; proxyType = 2; - remoteGlobalIDString = C8165ABC21891AFF00494BEF; - remoteInfo = RxAtomic; + remoteGlobalIDString = C88BB8711B07E5ED0064D411; + remoteInfo = "RxSwift-macOS"; + }; + 1E88A651226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D2EA280C1BB9B5A200880ED3; + remoteInfo = "RxSwift-tvOS"; + }; + 1E88A653226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C8F0C0021BBBFB8B001B112F; + remoteInfo = "RxSwift-watchOS"; + }; + 1E88A655226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C80939E71B8A71840088E94D; + remoteInfo = "RxCocoa-macOS"; + }; + 1E88A657226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D2138C751BB9BE9800339B5C; + remoteInfo = "RxCocoa-tvOS"; + }; + 1E88A659226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C8F0C04B1BBBFBB9001B112F; + remoteInfo = "RxCocoa-watchOS"; + }; + 1E88A65B226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C8093C451B8A71FC0088E94D; + remoteInfo = "RxBlocking-macOS"; + }; + 1E88A65D226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D2EBEB811BB9B99D003A27DC; + remoteInfo = "RxBlocking-tvOS"; + }; + 1E88A65F226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C8F0C0581BBBFBCE001B112F; + remoteInfo = "RxBlocking-watchOS"; + }; + 1E88A661226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C88FA51D1C25C4B500CCFEA4; + remoteInfo = "RxTest-macOS"; + }; + 1E88A663226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C88FA52E1C25C4C000CCFEA4; + remoteInfo = "RxTest-tvOS"; + }; + 1E88A665226C8A81007B9436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C88FA53F1C25C4CC00CCFEA4; + remoteInfo = "RxTest-watchOS"; }; C82C3C591F3B937500309AE8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -349,11 +426,22 @@ C88AC6FD214D9BA800C1A3E5 /* Products */ = { isa = PBXGroup; children = ( - B6F732B421C01D3B0007F9D9 /* RxAtomic.framework */, C88AC715214D9BA800C1A3E5 /* RxSwift.framework */, + 1E88A650226C8A81007B9436 /* RxSwift.framework */, + 1E88A652226C8A81007B9436 /* RxSwift.framework */, + 1E88A654226C8A81007B9436 /* RxSwift.framework */, C88AC71D214D9BA800C1A3E5 /* RxCocoa.framework */, + 1E88A656226C8A81007B9436 /* RxCocoa.framework */, + 1E88A658226C8A81007B9436 /* RxCocoa.framework */, + 1E88A65A226C8A81007B9436 /* RxCocoa.framework */, C88AC725214D9BA800C1A3E5 /* RxBlocking.framework */, + 1E88A65C226C8A81007B9436 /* RxBlocking.framework */, + 1E88A65E226C8A81007B9436 /* RxBlocking.framework */, + 1E88A660226C8A81007B9436 /* RxBlocking.framework */, C88AC72D214D9BA800C1A3E5 /* RxTest.framework */, + 1E88A662226C8A81007B9436 /* RxTest.framework */, + 1E88A664226C8A81007B9436 /* RxTest.framework */, + 1E88A666226C8A81007B9436 /* RxTest.framework */, C88AC735214D9BA800C1A3E5 /* AllTests-iOS.xctest */, C88AC737214D9BA800C1A3E5 /* AllTests-tvOS.xctest */, C88AC739214D9BA800C1A3E5 /* AllTests-macOS.xctest */, @@ -591,6 +679,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -615,11 +704,88 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - B6F732B421C01D3B0007F9D9 /* RxAtomic.framework */ = { + 1E88A650226C8A81007B9436 /* RxSwift.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxSwift.framework; + remoteRef = 1E88A64F226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A652226C8A81007B9436 /* RxSwift.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxSwift.framework; + remoteRef = 1E88A651226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A654226C8A81007B9436 /* RxSwift.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxSwift.framework; + remoteRef = 1E88A653226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A656226C8A81007B9436 /* RxCocoa.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxCocoa.framework; + remoteRef = 1E88A655226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A658226C8A81007B9436 /* RxCocoa.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxCocoa.framework; + remoteRef = 1E88A657226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A65A226C8A81007B9436 /* RxCocoa.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxCocoa.framework; + remoteRef = 1E88A659226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A65C226C8A81007B9436 /* RxBlocking.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxBlocking.framework; + remoteRef = 1E88A65B226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A65E226C8A81007B9436 /* RxBlocking.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = RxAtomic.framework; - remoteRef = B6F732B321C01D3B0007F9D9 /* PBXContainerItemProxy */; + path = RxBlocking.framework; + remoteRef = 1E88A65D226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A660226C8A81007B9436 /* RxBlocking.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxBlocking.framework; + remoteRef = 1E88A65F226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A662226C8A81007B9436 /* RxTest.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxTest.framework; + remoteRef = 1E88A661226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A664226C8A81007B9436 /* RxTest.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxTest.framework; + remoteRef = 1E88A663226C8A81007B9436 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1E88A666226C8A81007B9436 /* RxTest.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxTest.framework; + remoteRef = 1E88A665226C8A81007B9436 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; C88AC715214D9BA800C1A3E5 /* RxSwift.framework */ = { @@ -927,6 +1093,7 @@ INFOPLIST_FILE = Sources/Differentiator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = org.rxswiftcommunity.Differentiator; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -950,6 +1117,7 @@ INFOPLIST_FILE = Sources/Differentiator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = org.rxswiftcommunity.Differentiator; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1094,6 +1262,7 @@ INFOPLIST_FILE = Sources/RxDataSources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = kzaher.RxDataSources; PRODUCT_NAME = RxDataSources; SKIP_INSTALL = YES; @@ -1117,6 +1286,7 @@ INFOPLIST_FILE = Sources/RxDataSources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = kzaher.RxDataSources; PRODUCT_NAME = RxDataSources; SKIP_INSTALL = YES; diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index a49230cf..db622c9a 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -513,6 +513,7 @@ INFOPLIST_FILE = Sources/Differentiator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = org.rxswiftcommunity.Differentiator; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -536,6 +537,7 @@ INFOPLIST_FILE = Sources/Differentiator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = org.rxswiftcommunity.Differentiator; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -716,6 +718,7 @@ INFOPLIST_FILE = Sources/RxDataSources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = kzaher.RxDataSources; PRODUCT_NAME = RxDataSources; SKIP_INSTALL = YES; @@ -735,6 +738,7 @@ INFOPLIST_FILE = Sources/RxDataSources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = kzaher.RxDataSources; PRODUCT_NAME = RxDataSources; SKIP_INSTALL = YES; From de7af4eb76012bb121036c6904c2f1834a338eb6 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Mon, 22 Apr 2019 20:10:43 +0200 Subject: [PATCH 26/58] Fixes compilation. --- RxDataSources.xcodeproj/project.pbxproj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index db622c9a..53843f3c 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -581,19 +581,19 @@ ENABLE_TESTABILITY = YES; "FRAMEWORK_SEARCH_PATHS[sdk=appletvos*]" = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS", + "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", ); "FRAMEWORK_SEARCH_PATHS[sdk=appletvsimulator*]" = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS", + "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", ); "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)/Carthage/Build/iOS/Static", ); "FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)/Carthage/Build/iOS/Static", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -664,19 +664,19 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; "FRAMEWORK_SEARCH_PATHS[sdk=appletvos*]" = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS", + "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", ); "FRAMEWORK_SEARCH_PATHS[sdk=appletvsimulator*]" = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS", + "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", ); "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)/Carthage/Build/iOS/Static", ); "FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)/Carthage/Build/iOS/Static", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; From c811fa100821cd3fb07735b0edf6e4098e84c9c3 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Mon, 22 Apr 2019 21:01:46 +0200 Subject: [PATCH 27/58] Updates Podspecs. --- Differentiator.podspec | 2 +- RxDataSources.podspec | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Differentiator.podspec b/Differentiator.podspec index 3120ed9c..50dcbce9 100644 --- a/Differentiator.podspec +++ b/Differentiator.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Differentiator" - s.version = "3.2.0" + s.version = "4.0.0" s.summary = "Diff algorithm for UITableView and UICollectionView." s.description = <<-DESC Diff algorithm for UITableView and UICollectionView. diff --git a/RxDataSources.podspec b/RxDataSources.podspec index 42865494..058bb7c1 100644 --- a/RxDataSources.podspec +++ b/RxDataSources.podspec @@ -37,9 +37,9 @@ data s.swift_version = '5.0' s.source_files = 'Sources/RxDataSources/**/*.swift' - s.dependency 'Differentiator', '~> 3.0' - s.dependency 'RxSwift', '~> 4.5' - s.dependency 'RxCocoa', '~> 4.5' + s.dependency 'Differentiator', '~> 4.0' + s.dependency 'RxSwift', '~> 5.0' + s.dependency 'RxCocoa', '~> 5.0' s.ios.deployment_target = '8.0' s.tvos.deployment_target = '9.0' From 1b7808ad197a72c4f70fe11688010c496f2ebce8 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Mon, 29 Apr 2019 21:43:57 +0200 Subject: [PATCH 28/58] Bumps up major version. --- Cartfile | 2 +- Cartfile.resolved | 2 +- Differentiator.podspec | 2 +- RxDataSources.podspec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cartfile b/Cartfile index 8ca1c8e6..6a8bfd62 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "ReactiveX/RxSwift" ~> 4.4 +github "ReactiveX/RxSwift" ~> 5.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 16929f19..c175c514 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "ReactiveX/RxSwift" "4.5.0" +github "ReactiveX/RxSwift" "5.0.0" diff --git a/Differentiator.podspec b/Differentiator.podspec index 50dcbce9..5c586ad5 100644 --- a/Differentiator.podspec +++ b/Differentiator.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Differentiator" - s.version = "4.0.0" + s.version = "5.0.0" s.summary = "Diff algorithm for UITableView and UICollectionView." s.description = <<-DESC Diff algorithm for UITableView and UICollectionView. diff --git a/RxDataSources.podspec b/RxDataSources.podspec index 058bb7c1..28a286bd 100644 --- a/RxDataSources.podspec +++ b/RxDataSources.podspec @@ -37,7 +37,7 @@ data s.swift_version = '5.0' s.source_files = 'Sources/RxDataSources/**/*.swift' - s.dependency 'Differentiator', '~> 4.0' + s.dependency 'Differentiator', '~> 5.0' s.dependency 'RxSwift', '~> 5.0' s.dependency 'RxCocoa', '~> 5.0' From d5c33cf54f4bfd86d2ef537c9dca9f591ede0226 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Mon, 29 Apr 2019 22:02:09 +0200 Subject: [PATCH 29/58] Improves naming of the generic arguments. --- CHANGELOG.md | 7 ++ Package.resolved | 16 ---- Package.swift | 4 +- RxDataSources.xcodeproj/project.pbxproj | 2 + .../AnimatableSectionModel.swift | 2 - Sources/Differentiator/Changeset.swift | 16 ++-- Sources/Differentiator/Diff.swift | 73 ++++++++----------- Sources/Differentiator/SectionModel.swift | 2 - .../AnimationConfiguration.swift | 12 +-- .../CollectionViewSectionedDataSource.swift | 28 +++---- ...ctionViewSectionedAnimatedDataSource.swift | 8 +- ...lectionViewSectionedReloadDataSource.swift | 6 +- .../RxDataSources/RxPickerViewAdapter.swift | 36 ++++----- ...TableViewSectionedAnimatedDataSource.swift | 8 +- ...RxTableViewSectionedReloadDataSource.swift | 6 +- .../TableViewSectionedDataSource.swift | 33 ++++----- .../RxDataSources/UI+SectionedViewType.swift | 44 +++++------ 17 files changed, 138 insertions(+), 165 deletions(-) delete mode 100644 Package.resolved diff --git a/CHANGELOG.md b/CHANGELOG.md index 381c5d18..3ca21a9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ All notable changes to this project will be documented in this file. * Makes SectionModel and AnimatableSectionModel equatable when their model and items conforms to equatable. * Resolved issues with Animated Collection View #60 +## [4.0.0](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/4.0.0) + +* Swift 5.0 +* Fixes problems with `UICollectionView` animation crashes. +* Improves readability by renaming short generic names to more descriptive names. +* Changes frameworks to be static libs. (Carthage integration) + ## [3.1.0](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/3.1.0) * Xcode 10.0 compatibility. diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 4f553d3c..00000000 --- a/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "RxSwift", - "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", - "state": { - "branch": null, - "revision": "cce95dd704bc08cd3d69c087a05a6fc3118e2722", - "version": "4.5.0" - } - } - ] - }, - "version": 1 -} diff --git a/Package.swift b/Package.swift index 8dd0ca38..d98b1fe3 100644 --- a/Package.swift +++ b/Package.swift @@ -12,12 +12,12 @@ let package = Package( .library(name: "Differentiator", targets: ["Differentiator"]), ], dependencies: [ - .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "4.5.0")), + .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.0.0")), ], targets: [ .target(name: "RxDataSources", dependencies: ["Differentiator", "RxSwift", "RxCocoa"]), .target(name: "Differentiator"), .testTarget(name: "RxDataSourcesTests", dependencies: ["RxDataSources"]), ], - swiftLanguageVersions: [.v4_2, .v5] + swiftLanguageVersions: [.v5] ) diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index 53843f3c..eccacb27 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -71,6 +71,7 @@ 03EEEE851F5B7D5C006068BC /* Randomizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Randomizer.swift; sourceTree = ""; }; 03EEEE861F5B7D5C006068BC /* s.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = s.swift; sourceTree = ""; }; 03EEEE871F5B7D5C006068BC /* XCTest+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTest+Extensions.swift"; sourceTree = ""; }; + 1E38DA4A22778D1A00C07A09 /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; C81905AE1DEA019100AE679C /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; C81FBF451F3B9CED0094061E /* Differentiator.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Differentiator.podspec; sourceTree = ""; }; C81FBF5B1F3B9D4C0094061E /* Array+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Array+Extensions.swift"; sourceTree = ""; }; @@ -205,6 +206,7 @@ C8984C501C36AF35001E4272 = { isa = PBXGroup; children = ( + 1E38DA4A22778D1A00C07A09 /* Package.swift */, C8B438561F3BA49F00B6A80B /* CHANGELOG.md */, C81FBF5A1F3B9CF10094061E /* Podspecs */, C85EE5461C36F1FC0090614D /* Sources */, diff --git a/Sources/Differentiator/AnimatableSectionModel.swift b/Sources/Differentiator/AnimatableSectionModel.swift index f5683b37..fac8858c 100644 --- a/Sources/Differentiator/AnimatableSectionModel.swift +++ b/Sources/Differentiator/AnimatableSectionModel.swift @@ -48,7 +48,6 @@ extension AnimatableSectionModel } -#if swift(>=4.1) extension AnimatableSectionModel : Equatable where Section: Equatable { @@ -57,4 +56,3 @@ extension AnimatableSectionModel && lhs.items == rhs.items } } -#endif diff --git a/Sources/Differentiator/Changeset.swift b/Sources/Differentiator/Changeset.swift index b3e88a31..ceb1fe0e 100644 --- a/Sources/Differentiator/Changeset.swift +++ b/Sources/Differentiator/Changeset.swift @@ -8,13 +8,13 @@ import Foundation -public struct Changeset { - public typealias I = S.Item +public struct Changeset { + public typealias Item = Section.Item public let reloadData: Bool - public let originalSections: [S] - public let finalSections: [S] + public let originalSections: [Section] + public let finalSections: [Section] public let insertedSections: [Int] public let deletedSections: [Int] @@ -27,8 +27,8 @@ public struct Changeset { public let updatedItems: [ItemPath] init(reloadData: Bool = false, - originalSections: [S] = [], - finalSections: [S] = [], + originalSections: [Section] = [], + finalSections: [Section] = [], insertedSections: [Int] = [], deletedSections: [Int] = [], movedSections: [(from: Int, to: Int)] = [], @@ -55,8 +55,8 @@ public struct Changeset { self.updatedItems = updatedItems } - public static func initialValue(_ sections: [S]) -> Changeset { - return Changeset( + public static func initialValue(_ sections: [Section]) -> Changeset
{ + return Changeset
( reloadData: true, finalSections: sections, insertedSections: Array(0 ..< sections.count) as [Int] diff --git a/Sources/Differentiator/Diff.swift b/Sources/Differentiator/Diff.swift index 3e3d31d8..f5415906 100644 --- a/Sources/Differentiator/Diff.swift +++ b/Sources/Differentiator/Diff.swift @@ -104,8 +104,8 @@ public enum Diff { } } - private static func indexSections(_ sections: [S]) throws -> [S.Identity : Int] { - var indexedSections: [S.Identity : Int] = [:] + private static func indexSections(_ sections: [Section]) throws -> [Section.Identity : Int] { + var indexedSections: [Section.Identity : Int] = [:] for (i, section) in sections.enumerated() { guard indexedSections[section.identity] == nil else { #if DEBUG @@ -126,12 +126,12 @@ public enum Diff { //================================================================================ // swift dictionary optimizations { - private struct OptimizedIdentity : Hashable { + private struct OptimizedIdentity : Hashable { - let identity: UnsafePointer + let identity: UnsafePointer private let cachedHashValue: Int - init(_ identity: UnsafePointer) { + init(_ identity: UnsafePointer) { self.identity = identity self.cachedHashValue = identity.pointee.hashValue } @@ -140,7 +140,7 @@ public enum Diff { hasher.combine(self.cachedHashValue) } - static func == (lhs: OptimizedIdentity, rhs: OptimizedIdentity) -> Bool { + static func == (lhs: OptimizedIdentity, rhs: OptimizedIdentity) -> Bool { if lhs.hashValue != rhs.hashValue { return false } @@ -157,7 +157,7 @@ public enum Diff { private static func calculateAssociatedData( initialItemCache: ContiguousArray>, finalItemCache: ContiguousArray> - ) throws + ) throws -> (ContiguousArray>, ContiguousArray>) { typealias Identity = Item.Identity @@ -354,15 +354,15 @@ public enum Diff { // // There maybe exists a better division, but time will tell. // - public static func differencesForSectionedView( - initialSections: [S], - finalSections: [S]) - throws -> [Changeset] { - typealias I = S.Item + public static func differencesForSectionedView( + initialSections: [Section], + finalSections: [Section]) + throws -> [Changeset
] { + typealias I = Section.Item - var result: [Changeset] = [] + var result: [Changeset
] = [] - var sectionCommands = try CommandGenerator.generatorForInitialSections(initialSections, finalSections: finalSections) + var sectionCommands = try CommandGenerator
.generatorForInitialSections(initialSections, finalSections: finalSections) result.append(contentsOf: try sectionCommands.generateDeleteSectionsDeletedItemsAndUpdatedItems()) result.append(contentsOf: try sectionCommands.generateInsertAndMoveSections()) @@ -371,20 +371,11 @@ public enum Diff { return result } + private struct CommandGenerator { + typealias Item = Section.Item - @available(*, deprecated, renamed: "differencesForSectionedView(initialSections:finalSections:)") - public static func differencesForSectionedView( - _ initialSections: [S], - finalSections: [S]) - throws -> [Changeset] { - return try differencesForSectionedView(initialSections: initialSections, finalSections: finalSections) - } - - private struct CommandGenerator { - typealias Item = S.Item - - let initialSections: [S] - let finalSections: [S] + let initialSections: [Section] + let finalSections: [Section] let initialSectionData: ContiguousArray let finalSectionData: ContiguousArray @@ -396,9 +387,9 @@ public enum Diff { let finalItemCache: ContiguousArray> static func generatorForInitialSections( - _ initialSections: [S], - finalSections: [S] - ) throws -> CommandGenerator { + _ initialSections: [Section], + finalSections: [Section] + ) throws -> CommandGenerator
{ let (initialSectionData, finalSectionData) = try calculateSectionMovements(initialSections: initialSections, finalSections: finalSections) @@ -417,7 +408,7 @@ public enum Diff { finalSectionData: finalSectionData ) - return CommandGenerator( + return CommandGenerator
( initialSections: initialSections, finalSections: finalSections, @@ -526,7 +517,7 @@ public enum Diff { return (initialItemData, finalItemData) } - static func calculateSectionMovements(initialSections: [S], finalSections: [S]) throws + static func calculateSectionMovements(initialSections: [Section], finalSections: [Section]) throws -> (ContiguousArray, ContiguousArray) { let initialSectionIndexes = try Diff.indexSections(initialSections) @@ -609,13 +600,13 @@ public enum Diff { return (initialSectionData, finalSectionData) } - mutating func generateDeleteSectionsDeletedItemsAndUpdatedItems() throws -> [Changeset] { + mutating func generateDeleteSectionsDeletedItemsAndUpdatedItems() throws -> [Changeset
] { var deletedSections = [Int]() var deletedItems = [ItemPath]() var updatedItems = [ItemPath]() - var afterDeleteState = [S]() + var afterDeleteState = [Section]() // mark deleted items { // 1rst stage again (I know, I know ...) @@ -630,7 +621,7 @@ public enum Diff { continue } - var afterDeleteItems: [S.Item] = [] + var afterDeleteItems: [Section.Item] = [] for j in 0 ..< initialItems.count { let event = initialItemData[i][j].event switch event { @@ -648,7 +639,7 @@ public enum Diff { } } - afterDeleteState.append(try S.init(safeOriginal: initialSections[i], safeItems: afterDeleteItems)) + afterDeleteState.append(try Section.init(safeOriginal: initialSections[i], safeItems: afterDeleteItems)) } // } @@ -664,7 +655,7 @@ public enum Diff { )] } - func generateInsertAndMoveSections() throws -> [Changeset] { + func generateInsertAndMoveSections() throws -> [Changeset
] { var movedSections = [(from: Int, to: Int)]() var insertedSections = [Int]() @@ -696,7 +687,7 @@ public enum Diff { } // sections should be in place, but items should be original without deleted ones - let sectionsAfterChange: [S] = try self.finalSections.enumerated().map { i, s -> S in + let sectionsAfterChange: [Section] = try self.finalSections.enumerated().map { i, s -> Section in let event = self.finalSectionData[i].event if event == .inserted { @@ -707,7 +698,7 @@ public enum Diff { let originalSectionIndex = try finalSectionData[i].moveIndex.unwrap() let originalSection = initialSections[originalSectionIndex] - var items: [S.Item] = [] + var items: [Section.Item] = [] items.reserveCapacity(originalSection.items.count) let itemAssociatedData = self.initialItemData[originalSectionIndex] for j in 0 ..< originalSection.items.count { @@ -725,7 +716,7 @@ public enum Diff { items.append(finalItemCache[finalIndex.sectionIndex][finalIndex.itemIndex]) } - let modifiedSection = try S.init(safeOriginal: s, safeItems: items) + let modifiedSection = try Section.init(safeOriginal: s, safeItems: items) return modifiedSection } @@ -742,7 +733,7 @@ public enum Diff { )] } - mutating func generateInsertAndMovedItems() throws -> [Changeset] { + mutating func generateInsertAndMovedItems() throws -> [Changeset
] { var insertedItems = [ItemPath]() var movedItems = [(from: ItemPath, to: ItemPath)]() diff --git a/Sources/Differentiator/SectionModel.swift b/Sources/Differentiator/SectionModel.swift index 28e6f8a1..28456b6e 100644 --- a/Sources/Differentiator/SectionModel.swift +++ b/Sources/Differentiator/SectionModel.swift @@ -43,7 +43,6 @@ extension SectionModel { } } -#if swift(>=4.1) extension SectionModel : Equatable where Section: Equatable, ItemType: Equatable { @@ -52,4 +51,3 @@ extension SectionModel && lhs.items == rhs.items } } -#endif diff --git a/Sources/RxDataSources/AnimationConfiguration.swift b/Sources/RxDataSources/AnimationConfiguration.swift index 3d08a61f..72749e85 100644 --- a/Sources/RxDataSources/AnimationConfiguration.swift +++ b/Sources/RxDataSources/AnimationConfiguration.swift @@ -14,13 +14,13 @@ Exposes custom animation styles for insertion, deletion and reloading behavior. */ public struct AnimationConfiguration { - public let insertAnimation: UITableViewRowAnimation - public let reloadAnimation: UITableViewRowAnimation - public let deleteAnimation: UITableViewRowAnimation + public let insertAnimation: UITableView.RowAnimation + public let reloadAnimation: UITableView.RowAnimation + public let deleteAnimation: UITableView.RowAnimation - public init(insertAnimation: UITableViewRowAnimation = .automatic, - reloadAnimation: UITableViewRowAnimation = .automatic, - deleteAnimation: UITableViewRowAnimation = .automatic) { + public init(insertAnimation: UITableView.RowAnimation = .automatic, + reloadAnimation: UITableView.RowAnimation = .automatic, + deleteAnimation: UITableView.RowAnimation = .automatic) { self.insertAnimation = insertAnimation self.reloadAnimation = reloadAnimation self.deleteAnimation = deleteAnimation diff --git a/Sources/RxDataSources/CollectionViewSectionedDataSource.swift b/Sources/RxDataSources/CollectionViewSectionedDataSource.swift index 6146baec..3d9e4934 100644 --- a/Sources/RxDataSources/CollectionViewSectionedDataSource.swift +++ b/Sources/RxDataSources/CollectionViewSectionedDataSource.swift @@ -14,16 +14,16 @@ import RxCocoa #endif import Differentiator -open class CollectionViewSectionedDataSource +open class CollectionViewSectionedDataSource : NSObject , UICollectionViewDataSource , SectionedViewDataSourceType { - public typealias I = S.Item - public typealias Section = S - public typealias ConfigureCell = (CollectionViewSectionedDataSource, UICollectionView, IndexPath, I) -> UICollectionViewCell - public typealias ConfigureSupplementaryView = (CollectionViewSectionedDataSource, UICollectionView, String, IndexPath) -> UICollectionReusableView - public typealias MoveItem = (CollectionViewSectionedDataSource, _ sourceIndexPath:IndexPath, _ destinationIndexPath:IndexPath) -> Void - public typealias CanMoveItemAtIndexPath = (CollectionViewSectionedDataSource, IndexPath) -> Bool + public typealias Item = Section.Item + public typealias Section = Section + public typealias ConfigureCell = (CollectionViewSectionedDataSource
, UICollectionView, IndexPath, Item) -> UICollectionViewCell + public typealias ConfigureSupplementaryView = (CollectionViewSectionedDataSource
, UICollectionView, String, IndexPath) -> UICollectionReusableView + public typealias MoveItem = (CollectionViewSectionedDataSource
, _ sourceIndexPath:IndexPath, _ destinationIndexPath:IndexPath) -> Void + public typealias CanMoveItemAtIndexPath = (CollectionViewSectionedDataSource
, IndexPath) -> Bool public init( @@ -56,20 +56,20 @@ open class CollectionViewSectionedDataSource // and their relationship with section. // If particular item is mutable, that is irrelevant for this logic to function // properly. - public typealias SectionModelSnapshot = SectionModel + public typealias SectionModelSnapshot = SectionModel private var _sectionModels: [SectionModelSnapshot] = [] - open var sectionModels: [S] { + open var sectionModels: [Section] { return _sectionModels.map { Section(original: $0.model, items: $0.items) } } - open subscript(section: Int) -> S { + open subscript(section: Int) -> Section { let sectionModel = self._sectionModels[section] - return S(original: sectionModel.model, items: sectionModel.items) + return Section(original: sectionModel.model, items: sectionModel.items) } - open subscript(indexPath: IndexPath) -> I { + open subscript(indexPath: IndexPath) -> Item { get { return self._sectionModels[indexPath.section].items[indexPath.item] } @@ -84,7 +84,7 @@ open class CollectionViewSectionedDataSource return self[indexPath] } - open func setSections(_ sections: [S]) { + open func setSections(_ sections: [Section]) { self._sectionModels = sections.map { SectionModelSnapshot(model: $0, items: $0.items) } } @@ -111,7 +111,7 @@ open class CollectionViewSectionedDataSource #endif } } - open var canMoveItemAtIndexPath: ((CollectionViewSectionedDataSource, IndexPath) -> Bool)? { + open var canMoveItemAtIndexPath: ((CollectionViewSectionedDataSource
, IndexPath) -> Bool)? { didSet { #if DEBUG ensureNotMutatedAfterBinding() diff --git a/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift b/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift index 7e5b9d63..e17fcc24 100644 --- a/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift +++ b/Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift @@ -15,11 +15,11 @@ import RxCocoa #endif import Differentiator -open class RxCollectionViewSectionedAnimatedDataSource - : CollectionViewSectionedDataSource +open class RxCollectionViewSectionedAnimatedDataSource + : CollectionViewSectionedDataSource
, RxCollectionViewDataSourceType { - public typealias Element = [S] - public typealias DecideViewTransition = (CollectionViewSectionedDataSource, UICollectionView, [Changeset]) -> ViewTransition + public typealias Element = [Section] + public typealias DecideViewTransition = (CollectionViewSectionedDataSource
, UICollectionView, [Changeset
]) -> ViewTransition // animation configuration public var animationConfiguration: AnimationConfiguration diff --git a/Sources/RxDataSources/RxCollectionViewSectionedReloadDataSource.swift b/Sources/RxDataSources/RxCollectionViewSectionedReloadDataSource.swift index a5bbc7b8..bf7ae42a 100644 --- a/Sources/RxDataSources/RxCollectionViewSectionedReloadDataSource.swift +++ b/Sources/RxDataSources/RxCollectionViewSectionedReloadDataSource.swift @@ -15,11 +15,11 @@ import RxCocoa #endif import Differentiator -open class RxCollectionViewSectionedReloadDataSource - : CollectionViewSectionedDataSource +open class RxCollectionViewSectionedReloadDataSource + : CollectionViewSectionedDataSource
, RxCollectionViewDataSourceType { - public typealias Element = [S] + public typealias Element = [Section] open func collectionView(_ collectionView: UICollectionView, observedEvent: Event) { Binder(self) { dataSource, element in diff --git a/Sources/RxDataSources/RxPickerViewAdapter.swift b/Sources/RxDataSources/RxPickerViewAdapter.swift index 331be910..44261c73 100644 --- a/Sources/RxDataSources/RxPickerViewAdapter.swift +++ b/Sources/RxDataSources/RxPickerViewAdapter.swift @@ -26,7 +26,7 @@ items .disposed(by: disposeBag) */ -open class RxPickerViewStringAdapter: RxPickerViewDataSource, UIPickerViewDelegate { +open class RxPickerViewStringAdapter: RxPickerViewDataSource, UIPickerViewDelegate { /** - parameter dataSource - parameter pickerView @@ -35,9 +35,9 @@ open class RxPickerViewStringAdapter: RxPickerViewDataSource, UIPickerView - parameter component */ public typealias TitleForRow = ( - _ dataSource: RxPickerViewStringAdapter, + _ dataSource: RxPickerViewStringAdapter, _ pickerView: UIPickerView, - _ components: T, + _ components: Components, _ row: Int, _ component: Int ) -> String? @@ -50,7 +50,7 @@ open class RxPickerViewStringAdapter: RxPickerViewDataSource, UIPickerView - parameter numberOfRowsInComponent: Implementation of corresponding delegate method. - parameter titleForRow: Implementation of corresponding adapter method that converts component to `String`. */ - public init(components: T, + public init(components: Components, numberOfComponents: @escaping NumberOfComponents, numberOfRowsInComponent: @escaping NumberOfRowsInComponent, titleForRow: @escaping TitleForRow) { @@ -76,7 +76,7 @@ open class RxPickerViewStringAdapter: RxPickerViewDataSource, UIPickerView .disposed(by: disposeBag) */ -open class RxPickerViewAttributedStringAdapter: RxPickerViewDataSource, UIPickerViewDelegate { +open class RxPickerViewAttributedStringAdapter: RxPickerViewDataSource, UIPickerViewDelegate { /** - parameter dataSource - parameter pickerView @@ -85,9 +85,9 @@ open class RxPickerViewAttributedStringAdapter: RxPickerViewDataSource, UI - parameter component */ public typealias AttributedTitleForRow = ( - _ dataSource: RxPickerViewAttributedStringAdapter, + _ dataSource: RxPickerViewAttributedStringAdapter, _ pickerView: UIPickerView, - _ components: T, + _ components: Components, _ row: Int, _ component: Int ) -> NSAttributedString? @@ -100,7 +100,7 @@ open class RxPickerViewAttributedStringAdapter: RxPickerViewDataSource, UI - parameter numberOfRowsInComponent: Implementation of corresponding delegate method. - parameter attributedTitleForRow: Implementation of corresponding adapter method that converts component to `NSAttributedString`. */ - public init(components: T, + public init(components: Components, numberOfComponents: @escaping NumberOfComponents, numberOfRowsInComponent: @escaping NumberOfRowsInComponent, attributedTitleForRow: @escaping AttributedTitleForRow) { @@ -126,7 +126,7 @@ open class RxPickerViewAttributedStringAdapter: RxPickerViewDataSource, UI .disposed(by: disposeBag) */ -open class RxPickerViewViewAdapter: RxPickerViewDataSource, UIPickerViewDelegate { +open class RxPickerViewViewAdapter: RxPickerViewDataSource, UIPickerViewDelegate { /** - parameter dataSource - parameter pickerView @@ -136,9 +136,9 @@ open class RxPickerViewViewAdapter: RxPickerViewDataSource, UIPickerViewDe - parameter view */ public typealias ViewForRow = ( - _ dataSource: RxPickerViewViewAdapter, + _ dataSource: RxPickerViewViewAdapter, _ pickerView: UIPickerView, - _ components: T, + _ components: Components, _ row: Int, _ component: Int, _ view: UIView? @@ -152,7 +152,7 @@ open class RxPickerViewViewAdapter: RxPickerViewDataSource, UIPickerViewDe - parameter numberOfRowsInComponent: Implementation of corresponding delegate method. - parameter attributedTitleForRow: Implementation of corresponding adapter method that converts component to `UIView`. */ - public init(components: T, + public init(components: Components, numberOfComponents: @escaping NumberOfComponents, numberOfRowsInComponent: @escaping NumberOfRowsInComponent, viewForRow: @escaping ViewForRow) { @@ -168,7 +168,7 @@ open class RxPickerViewViewAdapter: RxPickerViewDataSource, UIPickerViewDe } /// A reactive UIPickerView data source -open class RxPickerViewDataSource: NSObject, UIPickerViewDataSource { +open class RxPickerViewDataSource: NSObject, UIPickerViewDataSource { /** - parameter dataSource - parameter pickerView @@ -177,7 +177,7 @@ open class RxPickerViewDataSource: NSObject, UIPickerViewDataSource { public typealias NumberOfComponents = ( _ dataSource: RxPickerViewDataSource, _ pickerView: UIPickerView, - _ components: T) -> Int + _ components: Components) -> Int /** - parameter dataSource - parameter pickerView @@ -187,18 +187,18 @@ open class RxPickerViewDataSource: NSObject, UIPickerViewDataSource { public typealias NumberOfRowsInComponent = ( _ dataSource: RxPickerViewDataSource, _ pickerView: UIPickerView, - _ components: T, + _ components: Components, _ component: Int ) -> Int - fileprivate var components: T + fileprivate var components: Components /** - parameter components: Initial content value. - parameter numberOfComponents: Implementation of corresponding delegate method. - parameter numberOfRowsInComponent: Implementation of corresponding delegate method. */ - init(components: T, + init(components: Components, numberOfComponents: @escaping NumberOfComponents, numberOfRowsInComponent: @escaping NumberOfRowsInComponent) { self.components = components @@ -222,7 +222,7 @@ open class RxPickerViewDataSource: NSObject, UIPickerViewDataSource { } extension RxPickerViewDataSource: RxPickerViewDataSourceType { - public func pickerView(_ pickerView: UIPickerView, observedEvent: Event) { + public func pickerView(_ pickerView: UIPickerView, observedEvent: Event) { Binder(self) { (dataSource, components) in dataSource.components = components pickerView.reloadAllComponents() diff --git a/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift b/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift index 23d6fb6f..b7f07f86 100644 --- a/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift +++ b/Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift @@ -15,11 +15,11 @@ import RxCocoa #endif import Differentiator -open class RxTableViewSectionedAnimatedDataSource - : TableViewSectionedDataSource +open class RxTableViewSectionedAnimatedDataSource + : TableViewSectionedDataSource
, RxTableViewDataSourceType { - public typealias Element = [S] - public typealias DecideViewTransition = (TableViewSectionedDataSource, UITableView, [Changeset]) -> ViewTransition + public typealias Element = [Section] + public typealias DecideViewTransition = (TableViewSectionedDataSource
, UITableView, [Changeset
]) -> ViewTransition /// Animation configuration for data source public var animationConfiguration: AnimationConfiguration diff --git a/Sources/RxDataSources/RxTableViewSectionedReloadDataSource.swift b/Sources/RxDataSources/RxTableViewSectionedReloadDataSource.swift index f1365d2c..19a924a4 100644 --- a/Sources/RxDataSources/RxTableViewSectionedReloadDataSource.swift +++ b/Sources/RxDataSources/RxTableViewSectionedReloadDataSource.swift @@ -15,10 +15,10 @@ import RxCocoa #endif import Differentiator -open class RxTableViewSectionedReloadDataSource - : TableViewSectionedDataSource +open class RxTableViewSectionedReloadDataSource + : TableViewSectionedDataSource
, RxTableViewDataSourceType { - public typealias Element = [S] + public typealias Element = [Section] open func tableView(_ tableView: UITableView, observedEvent: Event) { Binder(self) { dataSource, element in diff --git a/Sources/RxDataSources/TableViewSectionedDataSource.swift b/Sources/RxDataSources/TableViewSectionedDataSource.swift index e2b48a60..1bd4017b 100644 --- a/Sources/RxDataSources/TableViewSectionedDataSource.swift +++ b/Sources/RxDataSources/TableViewSectionedDataSource.swift @@ -14,23 +14,22 @@ import RxCocoa #endif import Differentiator -open class TableViewSectionedDataSource +open class TableViewSectionedDataSource : NSObject , UITableViewDataSource , SectionedViewDataSourceType { - public typealias I = S.Item - public typealias Section = S + public typealias Item = Section.Item - public typealias ConfigureCell = (TableViewSectionedDataSource, UITableView, IndexPath, I) -> UITableViewCell - public typealias TitleForHeaderInSection = (TableViewSectionedDataSource, Int) -> String? - public typealias TitleForFooterInSection = (TableViewSectionedDataSource, Int) -> String? - public typealias CanEditRowAtIndexPath = (TableViewSectionedDataSource, IndexPath) -> Bool - public typealias CanMoveRowAtIndexPath = (TableViewSectionedDataSource, IndexPath) -> Bool + public typealias ConfigureCell = (TableViewSectionedDataSource
, UITableView, IndexPath, Item) -> UITableViewCell + public typealias TitleForHeaderInSection = (TableViewSectionedDataSource
, Int) -> String? + public typealias TitleForFooterInSection = (TableViewSectionedDataSource
, Int) -> String? + public typealias CanEditRowAtIndexPath = (TableViewSectionedDataSource
, IndexPath) -> Bool + public typealias CanMoveRowAtIndexPath = (TableViewSectionedDataSource
, IndexPath) -> Bool #if os(iOS) - public typealias SectionIndexTitles = (TableViewSectionedDataSource) -> [String]? - public typealias SectionForSectionIndexTitle = (TableViewSectionedDataSource, _ title: String, _ index: Int) -> Int + public typealias SectionIndexTitles = (TableViewSectionedDataSource
) -> [String]? + public typealias SectionForSectionIndexTitle = (TableViewSectionedDataSource
, _ title: String, _ index: Int) -> Int #endif #if os(iOS) @@ -85,20 +84,20 @@ open class TableViewSectionedDataSource // and their relationship with section. // If particular item is mutable, that is irrelevant for this logic to function // properly. - public typealias SectionModelSnapshot = SectionModel + public typealias SectionModelSnapshot = SectionModel private var _sectionModels: [SectionModelSnapshot] = [] - open var sectionModels: [S] { + open var sectionModels: [Section] { return _sectionModels.map { Section(original: $0.model, items: $0.items) } } - open subscript(section: Int) -> S { + open subscript(section: Int) -> Section { let sectionModel = self._sectionModels[section] - return S(original: sectionModel.model, items: sectionModel.items) + return Section(original: sectionModel.model, items: sectionModel.items) } - open subscript(indexPath: IndexPath) -> I { + open subscript(indexPath: IndexPath) -> Item { get { return self._sectionModels[indexPath.section].items[indexPath.item] } @@ -113,7 +112,7 @@ open class TableViewSectionedDataSource return self[indexPath] } - open func setSections(_ sections: [S]) { + open func setSections(_ sections: [Section]) { self._sectionModels = sections.map { SectionModelSnapshot(model: $0, items: $0.items) } } @@ -155,8 +154,6 @@ open class TableViewSectionedDataSource } } - open var rowAnimation: UITableViewRowAnimation = .automatic - #if os(iOS) open var sectionIndexTitles: SectionIndexTitles { didSet { diff --git a/Sources/RxDataSources/UI+SectionedViewType.swift b/Sources/RxDataSources/UI+SectionedViewType.swift index 065fe975..bf4c3c24 100644 --- a/Sources/RxDataSources/UI+SectionedViewType.swift +++ b/Sources/RxDataSources/UI+SectionedViewType.swift @@ -11,10 +11,6 @@ import Foundation import UIKit import Differentiator -#if swift(>=4.2) -public typealias UITableViewRowAnimation = UITableView.RowAnimation -#endif - func indexSet(_ values: [Int]) -> IndexSet { let indexSet = NSMutableIndexSet() for i in values { @@ -25,11 +21,11 @@ func indexSet(_ values: [Int]) -> IndexSet { extension UITableView : SectionedViewType { - public func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) { + public func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) { self.insertRows(at: paths, with: animationStyle) } - public func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) { + public func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) { self.deleteRows(at: paths, with: animationStyle) } @@ -37,15 +33,15 @@ extension UITableView : SectionedViewType { self.moveRow(at: from, to: to) } - public func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) { + public func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) { self.reloadRows(at: paths, with: animationStyle) } - public func insertSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) { + public func insertSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) { self.insertSections(indexSet(sections), with: animationStyle) } - public func deleteSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) { + public func deleteSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) { self.deleteSections(indexSet(sections), with: animationStyle) } @@ -53,17 +49,17 @@ extension UITableView : SectionedViewType { self.moveSection(from, toSection: to) } - public func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) { + public func reloadSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) { self.reloadSections(indexSet(sections), with: animationStyle) } } extension UICollectionView : SectionedViewType { - public func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) { + public func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) { self.insertItems(at: paths) } - public func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) { + public func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) { self.deleteItems(at: paths) } @@ -71,15 +67,15 @@ extension UICollectionView : SectionedViewType { self.moveItem(at: from, to: to) } - public func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) { + public func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) { self.reloadItems(at: paths) } - public func insertSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) { + public func insertSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) { self.insertSections(indexSet(sections)) } - public func deleteSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) { + public func deleteSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) { self.deleteSections(indexSet(sections)) } @@ -87,26 +83,26 @@ extension UICollectionView : SectionedViewType { self.moveSection(from, toSection: to) } - public func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) { + public func reloadSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) { self.reloadSections(indexSet(sections)) } } public protocol SectionedViewType { - func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) - func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) + func insertItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) + func deleteItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) func moveItemAtIndexPath(_ from: IndexPath, to: IndexPath) - func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableViewRowAnimation) + func reloadItemsAtIndexPaths(_ paths: [IndexPath], animationStyle: UITableView.RowAnimation) - func insertSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) - func deleteSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) + func insertSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) + func deleteSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) func moveSection(_ from: Int, to: Int) - func reloadSections(_ sections: [Int], animationStyle: UITableViewRowAnimation) + func reloadSections(_ sections: [Int], animationStyle: UITableView.RowAnimation) } extension SectionedViewType { - public func batchUpdates(_ changes: Changeset, animationConfiguration: AnimationConfiguration) { - typealias I = S.Item + public func batchUpdates
(_ changes: Changeset
, animationConfiguration: AnimationConfiguration) { + typealias Item = Section.Item deleteSections(changes.deletedSections, animationStyle: animationConfiguration.deleteAnimation) From 92a7831ea8df2886138e14cd92b7195295aab921 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Mon, 29 Apr 2019 22:09:49 +0200 Subject: [PATCH 30/58] Fixes dependency versions. --- Differentiator.podspec | 2 +- RxDataSources.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Differentiator.podspec b/Differentiator.podspec index 5c586ad5..50dcbce9 100644 --- a/Differentiator.podspec +++ b/Differentiator.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Differentiator" - s.version = "5.0.0" + s.version = "4.0.0" s.summary = "Diff algorithm for UITableView and UICollectionView." s.description = <<-DESC Diff algorithm for UITableView and UICollectionView. diff --git a/RxDataSources.podspec b/RxDataSources.podspec index 28a286bd..058bb7c1 100644 --- a/RxDataSources.podspec +++ b/RxDataSources.podspec @@ -37,7 +37,7 @@ data s.swift_version = '5.0' s.source_files = 'Sources/RxDataSources/**/*.swift' - s.dependency 'Differentiator', '~> 5.0' + s.dependency 'Differentiator', '~> 4.0' s.dependency 'RxSwift', '~> 5.0' s.dependency 'RxCocoa', '~> 5.0' From 05ead9a086ed698137a36cd4789c6b23ddc69f55 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Mon, 29 Apr 2019 22:10:19 +0200 Subject: [PATCH 31/58] Cleanup of the changelog. --- CHANGELOG.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ca21a9d..74a2b4c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,7 @@ All notable changes to this project will be documented in this file. --- -#### Enhancements -* Reduce computational complexity. #242 -* Adapted for RxSwift 4.2 -* Makes SectionModel and AnimatableSectionModel equatable when their model and items conforms to equatable. -* Resolved issues with Animated Collection View #60 +#### Master ## [4.0.0](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/4.0.0) From af696ea05ff2d5815f4bd7b756d77ca9e7ed751d Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Tue, 30 Apr 2019 00:07:00 +0200 Subject: [PATCH 32/58] Fixes Carthage build. --- RxDataSources.xcodeproj/project.pbxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index eccacb27..260d72d1 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -584,18 +584,22 @@ "FRAMEWORK_SEARCH_PATHS[sdk=appletvos*]" = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", + "$(PROJECT_DIR)/Carthage/Build/tvOS/", ); "FRAMEWORK_SEARCH_PATHS[sdk=appletvsimulator*]" = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", + "$(PROJECT_DIR)/Carthage/Build/tvOS/", ); "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS/Static", + "$(PROJECT_DIR)/Carthage/Build/iOS/", ); "FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS/Static", + "$(PROJECT_DIR)/Carthage/Build/iOS/", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -667,18 +671,22 @@ "FRAMEWORK_SEARCH_PATHS[sdk=appletvos*]" = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", + "$(PROJECT_DIR)/Carthage/Build/tvOS/", ); "FRAMEWORK_SEARCH_PATHS[sdk=appletvsimulator*]" = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", + "$(PROJECT_DIR)/Carthage/Build/tvOS/", ); "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS/Static", + "$(PROJECT_DIR)/Carthage/Build/iOS/", ); "FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS/Static", + "$(PROJECT_DIR)/Carthage/Build/iOS/", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; From 7e111d7b63595a4268a9e99979d7a1583fa9fdae Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Tue, 30 Apr 2019 00:27:07 +0200 Subject: [PATCH 33/58] Fixes test extensions. --- .../ChangeSet+TestExtensions.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Tests/RxDataSourcesTests/ChangeSet+TestExtensions.swift b/Tests/RxDataSourcesTests/ChangeSet+TestExtensions.swift index 1cc3865f..b9fc05e6 100644 --- a/Tests/RxDataSourcesTests/ChangeSet+TestExtensions.swift +++ b/Tests/RxDataSourcesTests/ChangeSet+TestExtensions.swift @@ -86,7 +86,7 @@ extension Changeset { extension Changeset { - fileprivate func apply(original: [S]) -> [S] { + fileprivate func apply(original: [Section]) -> [Section] { let afterDeletesAndUpdates = applyDeletesAndUpdates(original: original) let afterSectionMovesAndInserts = applySectionMovesAndInserts(original: afterDeletesAndUpdates) @@ -95,8 +95,8 @@ extension Changeset { return afterItemInsertsAndMoves } - private func applyDeletesAndUpdates(original: [S]) -> [S] { - var resultAfterDeletesAndUpdates: [SectionModelTypeWrapper] = SectionModelTypeWrapper.wrap(original) + private func applyDeletesAndUpdates(original: [Section]) -> [Section] { + var resultAfterDeletesAndUpdates: [SectionModelTypeWrapper
] = SectionModelTypeWrapper.wrap(original) for index in updatedItems { resultAfterDeletesAndUpdates[index.sectionIndex].items[index.itemIndex].updated = true @@ -124,7 +124,7 @@ extension Changeset { return SectionModelTypeWrapper.unwrap(resultAfterDeletesAndUpdates) } - private func applySectionMovesAndInserts(original: [S]) -> [S] { + private func applySectionMovesAndInserts(original: [Section]) -> [Section] { if !updatedSections.isEmpty { fatalError("Section updates aren't supported") } @@ -149,7 +149,7 @@ extension Changeset { let totalCount = original.count + insertedSections.count - var results: [S] = [] + var results: [Section] = [] for index in 0 ..< totalCount { if insertedSectionsIndexes.contains(index) { @@ -170,8 +170,8 @@ extension Changeset { return results } - private func applyItemInsertsAndMoves(original: [S]) -> [S] { - var resultAfterInsertsAndMoves: [S] = original + private func applyItemInsertsAndMoves(original: [Section]) -> [Section] { + var resultAfterInsertsAndMoves: [Section] = original let sourceIndexesThatShouldBeMoved = Set(movedItems.map { $0.from }) let destinationToSourceMapping = Dictionary(elements: self.movedItems, keySelector: { $0.to }, valueSelector: { $0.from }) @@ -210,7 +210,7 @@ extension Changeset { + movedInSection[sectionIndex] - movedOutSection[sectionIndex] - var resultItems: [S.Item] = [] + var resultItems: [Section.Item] = [] for index in 0 ..< totalCount { let itemPath = ItemPath(sectionIndex: sectionIndex, itemIndex: index) @@ -229,7 +229,7 @@ extension Changeset { } } - resultAfterInsertsAndMoves[sectionIndex] = S(original: section, items: resultItems) + resultAfterInsertsAndMoves[sectionIndex] = Section(original: section, items: resultItems) } return resultAfterInsertsAndMoves From fffb041b21a5deee5d353d33b5f199f6fd2b5b44 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Tue, 30 Apr 2019 19:53:54 +0200 Subject: [PATCH 34/58] Release 4.0.1 --- CHANGELOG.md | 4 ++++ Cartfile.resolved | 2 +- RxDataSources.xcodeproj/project.pbxproj | 4 ---- Sources/Differentiator/Info.plist | 2 +- Sources/RxDataSources/Info.plist | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74a2b4c7..d11e7f6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. #### Master +## [4.0.1](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/4.0.1) + +* Fixes Carthage integration and reverts static frameworks to dynamic frameworks. + ## [4.0.0](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/4.0.0) * Swift 5.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index c175c514..b751e3d5 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "ReactiveX/RxSwift" "5.0.0" +github "ReactiveX/RxSwift" "5.0.1" diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index 260d72d1..05b399dd 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -515,7 +515,6 @@ INFOPLIST_FILE = Sources/Differentiator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = org.rxswiftcommunity.Differentiator; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -539,7 +538,6 @@ INFOPLIST_FILE = Sources/Differentiator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = org.rxswiftcommunity.Differentiator; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -728,7 +726,6 @@ INFOPLIST_FILE = Sources/RxDataSources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = kzaher.RxDataSources; PRODUCT_NAME = RxDataSources; SKIP_INSTALL = YES; @@ -748,7 +745,6 @@ INFOPLIST_FILE = Sources/RxDataSources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; PRODUCT_BUNDLE_IDENTIFIER = kzaher.RxDataSources; PRODUCT_NAME = RxDataSources; SKIP_INSTALL = YES; diff --git a/Sources/Differentiator/Info.plist b/Sources/Differentiator/Info.plist index 9f023d2b..9a3b7072 100644 --- a/Sources/Differentiator/Info.plist +++ b/Sources/Differentiator/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.0.2 + 4.0.1 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Sources/RxDataSources/Info.plist b/Sources/RxDataSources/Info.plist index 49ca846d..d7feac3e 100644 --- a/Sources/RxDataSources/Info.plist +++ b/Sources/RxDataSources/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.0.2 + 4.0.1 CFBundleSignature ???? CFBundleVersion From 5c1a2f3dde7e1fc6c345dd861f4987c0bda5ebf6 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Tue, 30 Apr 2019 21:04:33 +0200 Subject: [PATCH 35/58] Fix example app. --- Examples/Example.xcodeproj/project.pbxproj | 190 +++------------------ 1 file changed, 21 insertions(+), 169 deletions(-) diff --git a/Examples/Example.xcodeproj/project.pbxproj b/Examples/Example.xcodeproj/project.pbxproj index b1ce924a..6831feec 100644 --- a/Examples/Example.xcodeproj/project.pbxproj +++ b/Examples/Example.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 1E38DA572278D39400C07A09 /* RxRelay.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E38DA562278D39400C07A09 /* RxRelay.framework */; }; + 1E38DA582278D39400C07A09 /* RxRelay.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1E38DA562278D39400C07A09 /* RxRelay.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 845F61F41CCFD96800A8BE32 /* Example4_DifferentSectionAndItemTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845F61F31CCFD96800A8BE32 /* Example4_DifferentSectionAndItemTypes.swift */; }; 845F61F71CCFDE6A00A8BE32 /* ImageTitleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845F61F61CCFDE6A00A8BE32 /* ImageTitleTableViewCell.swift */; }; 845F61F91CCFDEA800A8BE32 /* TitleSwitchTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845F61F81CCFDEA800A8BE32 /* TitleSwitchTableViewCell.swift */; }; @@ -63,89 +65,19 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1E88A64F226C8A81007B9436 /* PBXContainerItemProxy */ = { + 1E38DA552278D39400C07A09 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; proxyType = 2; - remoteGlobalIDString = C88BB8711B07E5ED0064D411; - remoteInfo = "RxSwift-macOS"; + remoteGlobalIDString = A2897D53225CA1E7004EA481; + remoteInfo = RxRelay; }; - 1E88A651226C8A81007B9436 /* PBXContainerItemProxy */ = { + 1E38DA592278D39400C07A09 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2EA280C1BB9B5A200880ED3; - remoteInfo = "RxSwift-tvOS"; - }; - 1E88A653226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C8F0C0021BBBFB8B001B112F; - remoteInfo = "RxSwift-watchOS"; - }; - 1E88A655226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C80939E71B8A71840088E94D; - remoteInfo = "RxCocoa-macOS"; - }; - 1E88A657226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2138C751BB9BE9800339B5C; - remoteInfo = "RxCocoa-tvOS"; - }; - 1E88A659226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C8F0C04B1BBBFBB9001B112F; - remoteInfo = "RxCocoa-watchOS"; - }; - 1E88A65B226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C8093C451B8A71FC0088E94D; - remoteInfo = "RxBlocking-macOS"; - }; - 1E88A65D226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2EBEB811BB9B99D003A27DC; - remoteInfo = "RxBlocking-tvOS"; - }; - 1E88A65F226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C8F0C0581BBBFBCE001B112F; - remoteInfo = "RxBlocking-watchOS"; - }; - 1E88A661226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C88FA51D1C25C4B500CCFEA4; - remoteInfo = "RxTest-macOS"; - }; - 1E88A663226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C88FA52E1C25C4C000CCFEA4; - remoteInfo = "RxTest-tvOS"; - }; - 1E88A665226C8A81007B9436 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = C88AC6FC214D9BA800C1A3E5 /* Rx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C88FA53F1C25C4CC00CCFEA4; - remoteInfo = "RxTest-watchOS"; + proxyType = 1; + remoteGlobalIDString = A2897CB3225CA1E7004EA481; + remoteInfo = RxRelay; }; C82C3C591F3B937500309AE8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -265,6 +197,7 @@ C87C34A31F363B3000DB85FE /* RxDataSources.framework in Embed Frameworks */, C82C3C5C1F3B937500309AE8 /* Differentiator.framework in Embed Frameworks */, C8241D7D214E75C6008C463E /* RxSwift.framework in Embed Frameworks */, + 1E38DA582278D39400C07A09 /* RxRelay.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -359,6 +292,7 @@ files = ( C87C34A21F363B3000DB85FE /* RxDataSources.framework in Frameworks */, C82C3C5B1F3B937500309AE8 /* Differentiator.framework in Frameworks */, + 1E38DA572278D39400C07A09 /* RxRelay.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -427,21 +361,10 @@ isa = PBXGroup; children = ( C88AC715214D9BA800C1A3E5 /* RxSwift.framework */, - 1E88A650226C8A81007B9436 /* RxSwift.framework */, - 1E88A652226C8A81007B9436 /* RxSwift.framework */, - 1E88A654226C8A81007B9436 /* RxSwift.framework */, C88AC71D214D9BA800C1A3E5 /* RxCocoa.framework */, - 1E88A656226C8A81007B9436 /* RxCocoa.framework */, - 1E88A658226C8A81007B9436 /* RxCocoa.framework */, - 1E88A65A226C8A81007B9436 /* RxCocoa.framework */, + 1E38DA562278D39400C07A09 /* RxRelay.framework */, C88AC725214D9BA800C1A3E5 /* RxBlocking.framework */, - 1E88A65C226C8A81007B9436 /* RxBlocking.framework */, - 1E88A65E226C8A81007B9436 /* RxBlocking.framework */, - 1E88A660226C8A81007B9436 /* RxBlocking.framework */, C88AC72D214D9BA800C1A3E5 /* RxTest.framework */, - 1E88A662226C8A81007B9436 /* RxTest.framework */, - 1E88A664226C8A81007B9436 /* RxTest.framework */, - 1E88A666226C8A81007B9436 /* RxTest.framework */, C88AC735214D9BA800C1A3E5 /* AllTests-iOS.xctest */, C88AC737214D9BA800C1A3E5 /* AllTests-tvOS.xctest */, C88AC739214D9BA800C1A3E5 /* AllTests-macOS.xctest */, @@ -619,6 +542,7 @@ dependencies = ( C87C34651F36353B00DB85FE /* PBXTargetDependency */, C82C3C5A1F3B937500309AE8 /* PBXTargetDependency */, + 1E38DA5A2278D39400C07A09 /* PBXTargetDependency */, ); name = Example; productName = Example; @@ -704,88 +628,11 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1E88A650226C8A81007B9436 /* RxSwift.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxSwift.framework; - remoteRef = 1E88A64F226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A652226C8A81007B9436 /* RxSwift.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxSwift.framework; - remoteRef = 1E88A651226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A654226C8A81007B9436 /* RxSwift.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxSwift.framework; - remoteRef = 1E88A653226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A656226C8A81007B9436 /* RxCocoa.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxCocoa.framework; - remoteRef = 1E88A655226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A658226C8A81007B9436 /* RxCocoa.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxCocoa.framework; - remoteRef = 1E88A657226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A65A226C8A81007B9436 /* RxCocoa.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxCocoa.framework; - remoteRef = 1E88A659226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A65C226C8A81007B9436 /* RxBlocking.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxBlocking.framework; - remoteRef = 1E88A65B226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A65E226C8A81007B9436 /* RxBlocking.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxBlocking.framework; - remoteRef = 1E88A65D226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A660226C8A81007B9436 /* RxBlocking.framework */ = { + 1E38DA562278D39400C07A09 /* RxRelay.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = RxBlocking.framework; - remoteRef = 1E88A65F226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A662226C8A81007B9436 /* RxTest.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxTest.framework; - remoteRef = 1E88A661226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A664226C8A81007B9436 /* RxTest.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxTest.framework; - remoteRef = 1E88A663226C8A81007B9436 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1E88A666226C8A81007B9436 /* RxTest.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = RxTest.framework; - remoteRef = 1E88A665226C8A81007B9436 /* PBXContainerItemProxy */; + path = RxRelay.framework; + remoteRef = 1E38DA552278D39400C07A09 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; C88AC715214D9BA800C1A3E5 /* RxSwift.framework */ = { @@ -992,6 +839,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 1E38DA5A2278D39400C07A09 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = RxRelay; + targetProxy = 1E38DA592278D39400C07A09 /* PBXContainerItemProxy */; + }; C82C3C5A1F3B937500309AE8 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = C82C3C531F3B937500309AE8 /* Differentiator */; From a18cee01c9ee55f04d0c7eb15c77a96c3648c88e Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Tue, 30 Apr 2019 22:11:34 +0200 Subject: [PATCH 36/58] Update podspecs. --- Differentiator.podspec | 2 +- RxDataSources.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Differentiator.podspec b/Differentiator.podspec index 50dcbce9..32849a82 100644 --- a/Differentiator.podspec +++ b/Differentiator.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Differentiator" - s.version = "4.0.0" + s.version = "4.0.1" s.summary = "Diff algorithm for UITableView and UICollectionView." s.description = <<-DESC Diff algorithm for UITableView and UICollectionView. diff --git a/RxDataSources.podspec b/RxDataSources.podspec index 058bb7c1..2115ffc8 100644 --- a/RxDataSources.podspec +++ b/RxDataSources.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxDataSources" - s.version = "4.0.0" + s.version = "4.0.1" s.summary = "This is a collection of reactive data sources for UITableView and UICollectionView." s.description = <<-DESC This is a collection of reactive data sources for UITableView and UICollectionView. From 8e5e3fe618bcabae22d9eb48831107b70c001072 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Thu, 9 May 2019 12:17:42 -0400 Subject: [PATCH 37/58] Fix Build / Carthage --- .gitmodules | 3 + Carthage/Checkouts/RxSwift | 1 + RxDataSources.xcodeproj/project.pbxproj | 181 ++++++++++++++++++++++++ 3 files changed, 185 insertions(+) create mode 100644 .gitmodules create mode 160000 Carthage/Checkouts/RxSwift diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..293c9c47 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Carthage/Checkouts/RxSwift"] + path = Carthage/Checkouts/RxSwift + url = https://github.com/ReactiveX/RxSwift.git diff --git a/Carthage/Checkouts/RxSwift b/Carthage/Checkouts/RxSwift new file mode 160000 index 00000000..b3e888b4 --- /dev/null +++ b/Carthage/Checkouts/RxSwift @@ -0,0 +1 @@ +Subproject commit b3e888b4972d9bc76495dd74d30a8c7fad4b9395 diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index 05b399dd..fdfdf02e 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -15,6 +15,8 @@ 03EEEE961F5B7D71006068BC /* Randomizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE851F5B7D5C006068BC /* Randomizer.swift */; }; 03EEEE971F5B7D71006068BC /* s.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE861F5B7D5C006068BC /* s.swift */; }; 03EEEE981F5B7D71006068BC /* XCTest+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE871F5B7D5C006068BC /* XCTest+Extensions.swift */; }; + 80FB1F5C228489FF009D6516 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F48228489EC009D6516 /* RxSwift.framework */; }; + 80FB1F5D22848A0E009D6516 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F4A228489EC009D6516 /* RxCocoa.framework */; }; C81FBF461F3B9CED0094061E /* Differentiator.podspec in Resources */ = {isa = PBXBuildFile; fileRef = C81FBF451F3B9CED0094061E /* Differentiator.podspec */; }; C81FBF5E1F3B9D660094061E /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81FBF5B1F3B9D4C0094061E /* Array+Extensions.swift */; }; C81FBF601F3B9D8B0094061E /* FloatingPointType+IdentifiableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81FBF5F1F3B9D8B0094061E /* FloatingPointType+IdentifiableType.swift */; }; @@ -52,6 +54,76 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 80FB1F47228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C8A56AD71AD7424700B4673B; + remoteInfo = RxSwift; + }; + 80FB1F49228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C809396D1B8A71760088E94D; + remoteInfo = RxCocoa; + }; + 80FB1F4B228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A2897D53225CA1E7004EA481; + remoteInfo = RxRelay; + }; + 80FB1F4D228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C8093BC71B8A71F00088E94D; + remoteInfo = RxBlocking; + }; + 80FB1F4F228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C88FA50C1C25C44800CCFEA4; + remoteInfo = RxTest; + }; + 80FB1F51228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C83508C31C386F6F0027C24C; + remoteInfo = "AllTests-iOS"; + }; + 80FB1F53228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C83509841C38740E0027C24C; + remoteInfo = "AllTests-tvOS"; + }; + 80FB1F55228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C83509941C38742C0027C24C; + remoteInfo = "AllTests-macOS"; + }; + 80FB1F57228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C85BA04B1C3878740075D68E; + remoteInfo = Microoptimizations; + }; + 80FB1F59228489EC009D6516 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C8E8BA551E2C181A00A4AC2C; + remoteInfo = Benchmarks; + }; C82C3C9A1F3B93D200309AE8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C8984C511C36AF35001E4272 /* Project object */; @@ -72,6 +144,7 @@ 03EEEE861F5B7D5C006068BC /* s.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = s.swift; sourceTree = ""; }; 03EEEE871F5B7D5C006068BC /* XCTest+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTest+Extensions.swift"; sourceTree = ""; }; 1E38DA4A22778D1A00C07A09 /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; + 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Rx.xcodeproj; path = Carthage/Checkouts/RxSwift/Rx.xcodeproj; sourceTree = ""; }; C81905AE1DEA019100AE679C /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; C81FBF451F3B9CED0094061E /* Differentiator.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Differentiator.podspec; sourceTree = ""; }; C81FBF5B1F3B9D4C0094061E /* Array+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Array+Extensions.swift"; sourceTree = ""; }; @@ -133,6 +206,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 80FB1F5D22848A0E009D6516 /* RxCocoa.framework in Frameworks */, + 80FB1F5C228489FF009D6516 /* RxSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -164,6 +239,30 @@ path = RxDataSourcesTests; sourceTree = ""; }; + 80FB1F3B228489EB009D6516 /* Products */ = { + isa = PBXGroup; + children = ( + 80FB1F48228489EC009D6516 /* RxSwift.framework */, + 80FB1F4A228489EC009D6516 /* RxCocoa.framework */, + 80FB1F4C228489EC009D6516 /* RxRelay.framework */, + 80FB1F4E228489EC009D6516 /* RxBlocking.framework */, + 80FB1F50228489EC009D6516 /* RxTest.framework */, + 80FB1F52228489EC009D6516 /* AllTests-iOS.xctest */, + 80FB1F54228489EC009D6516 /* AllTests-tvOS.xctest */, + 80FB1F56228489EC009D6516 /* AllTests-macOS.xctest */, + 80FB1F58228489EC009D6516 /* PerformanceTests.app */, + 80FB1F5A228489EC009D6516 /* Benchmarks.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 80FB1F5B228489FF009D6516 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; C81FBF5A1F3B9CF10094061E /* Podspecs */ = { isa = PBXGroup; children = ( @@ -212,6 +311,8 @@ C85EE5461C36F1FC0090614D /* Sources */, 03EEEE7D1F5B7D5C006068BC /* Tests */, C8984C5B1C36AF35001E4272 /* Products */, + 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */, + 80FB1F5B228489FF009D6516 /* Frameworks */, ); sourceTree = ""; }; @@ -361,6 +462,12 @@ mainGroup = C8984C501C36AF35001E4272; productRefGroup = C8984C5B1C36AF35001E4272 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 80FB1F3B228489EB009D6516 /* Products */; + ProjectRef = 80FB1F3A228489EB009D6516 /* Rx.xcodeproj */; + }, + ); projectRoot = ""; targets = ( C8984C591C36AF35001E4272 /* RxDataSources */, @@ -370,6 +477,80 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + 80FB1F48228489EC009D6516 /* RxSwift.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxSwift.framework; + remoteRef = 80FB1F47228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 80FB1F4A228489EC009D6516 /* RxCocoa.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxCocoa.framework; + remoteRef = 80FB1F49228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 80FB1F4C228489EC009D6516 /* RxRelay.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxRelay.framework; + remoteRef = 80FB1F4B228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 80FB1F4E228489EC009D6516 /* RxBlocking.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxBlocking.framework; + remoteRef = 80FB1F4D228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 80FB1F50228489EC009D6516 /* RxTest.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = RxTest.framework; + remoteRef = 80FB1F4F228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 80FB1F52228489EC009D6516 /* AllTests-iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "AllTests-iOS.xctest"; + remoteRef = 80FB1F51228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 80FB1F54228489EC009D6516 /* AllTests-tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "AllTests-tvOS.xctest"; + remoteRef = 80FB1F53228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 80FB1F56228489EC009D6516 /* AllTests-macOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "AllTests-macOS.xctest"; + remoteRef = 80FB1F55228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 80FB1F58228489EC009D6516 /* PerformanceTests.app */ = { + isa = PBXReferenceProxy; + fileType = wrapper.application; + name = PerformanceTests.app; + path = Microoptimizations.app; + remoteRef = 80FB1F57228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 80FB1F5A228489EC009D6516 /* Benchmarks.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = Benchmarks.xctest; + remoteRef = 80FB1F59228489EC009D6516 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ C81905AC1DEA019100AE679C /* Resources */ = { isa = PBXResourcesBuildPhase; From 8abe183519b8bb52c9c130a07d7ef61943672027 Mon Sep 17 00:00:00 2001 From: Bifidy CAPs Date: Tue, 28 May 2019 17:21:56 +0800 Subject: [PATCH 38/58] fix version number after update to 4.0 fix version number in Installation section after update to 4.0. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c714c08d..bb441c74 100644 --- a/README.md +++ b/README.md @@ -159,12 +159,12 @@ For Swift 2.3 version please use versions `0.1 ... 0.9` Podfile ``` -pod 'RxDataSources', '~> 3.0' +pod 'RxDataSources', '~> 4.0' ``` ### Carthage Cartfile ``` -github "RxSwiftCommunity/RxDataSources" ~> 3.0 +github "RxSwiftCommunity/RxDataSources" ~> 4.0 ``` From 4747102f7e2b1c4f10252a2bcfa7b11bfd9106d7 Mon Sep 17 00:00:00 2001 From: Meng Li Date: Thu, 30 May 2019 17:34:48 +0900 Subject: [PATCH 39/58] Make the random number range larger. --- Examples/Example/Example3_TableViewEditing.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/Example/Example3_TableViewEditing.swift b/Examples/Example/Example3_TableViewEditing.swift index ef89cb9b..23eed5c2 100644 --- a/Examples/Example/Example3_TableViewEditing.swift +++ b/Examples/Example/Example3_TableViewEditing.swift @@ -140,8 +140,8 @@ struct SectionedTableViewState { extension TableViewEditingCommand { static func addRandomItem() -> TableViewEditingCommand { - let randSection = Int(arc4random_uniform(UInt32(3))) - let number = Int(arc4random_uniform(UInt32(100))) + let randSection = Int.random(in: 0...2) + let number = Int.random(in: 0...10000) let item = IntItem(number: number, date: Date()) return TableViewEditingCommand.AppendItem(item: item, section: randSection) } From 76973cd78e853cdcf4e6781f8dde002a6518198d Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Mon, 3 Jun 2019 22:26:01 +0200 Subject: [PATCH 40/58] Improve item generation. --- Examples/Example/Example3_TableViewEditing.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Examples/Example/Example3_TableViewEditing.swift b/Examples/Example/Example3_TableViewEditing.swift index 23eed5c2..1b817527 100644 --- a/Examples/Example/Example3_TableViewEditing.swift +++ b/Examples/Example/Example3_TableViewEditing.swift @@ -139,9 +139,11 @@ struct SectionedTableViewState { } extension TableViewEditingCommand { + static var nextNumber = 0 static func addRandomItem() -> TableViewEditingCommand { let randSection = Int.random(in: 0...2) - let number = Int.random(in: 0...10000) + let number = nextNumber + defer { nextNumber = nextNumber + 1 } let item = IntItem(number: number, date: Date()) return TableViewEditingCommand.AppendItem(item: item, section: randSection) } From 06b7b21eb41f61b1909adb1ac48e7b015e9ecc86 Mon Sep 17 00:00:00 2001 From: antonnazarov Date: Tue, 2 Jul 2019 02:10:36 +0300 Subject: [PATCH 41/58] Migrate example app to swift 5 --- Examples/Example.xcodeproj/project.pbxproj | 10 ++++++++++ .../Example/Example2_RandomizedSectionsAnimation.swift | 2 +- Examples/Example/Example5_UIPickerView.swift | 6 +++--- Examples/Example/Support/AppDelegate.swift | 4 +--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Examples/Example.xcodeproj/project.pbxproj b/Examples/Example.xcodeproj/project.pbxproj index 6831feec..7bd0bd7e 100644 --- a/Examples/Example.xcodeproj/project.pbxproj +++ b/Examples/Example.xcodeproj/project.pbxproj @@ -910,6 +910,7 @@ PRODUCT_BUNDLE_IDENTIFIER = io.rx.Tests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -927,6 +928,7 @@ PRODUCT_BUNDLE_IDENTIFIER = io.rx.Tests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -951,6 +953,7 @@ SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -975,6 +978,7 @@ SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -1119,6 +1123,7 @@ PRODUCT_NAME = RxDataSources; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1144,6 +1149,7 @@ SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -1162,6 +1168,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = kzaher.Example; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1182,6 +1189,7 @@ PRODUCT_BUNDLE_IDENTIFIER = kzaher.Example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -1194,6 +1202,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = kzaher.ExampleUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = Example; USES_XCTRUNNER = YES; }; @@ -1208,6 +1217,7 @@ PRODUCT_BUNDLE_IDENTIFIER = kzaher.ExampleUITests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = Example; USES_XCTRUNNER = YES; }; diff --git a/Examples/Example/Example2_RandomizedSectionsAnimation.swift b/Examples/Example/Example2_RandomizedSectionsAnimation.swift index 4951c30c..513e8586 100644 --- a/Examples/Example/Example2_RandomizedSectionsAnimation.swift +++ b/Examples/Example/Example2_RandomizedSectionsAnimation.swift @@ -34,7 +34,7 @@ class PartialUpdatesViewController: UIViewController { let initialRandomizedSections = Randomizer(rng: PseudoRandomGenerator(4, 3), sections: initialValue()) - let ticks = Observable.interval(1, scheduler: MainScheduler.instance).map { _ in () } + let ticks = Observable.interval(.seconds(1), scheduler: MainScheduler.instance).map { _ in () } let randomSections = Observable.of(ticks, refreshButton.rx.tap.asObservable()) .merge() .scan(initialRandomizedSections) { a, _ in diff --git a/Examples/Example/Example5_UIPickerView.swift b/Examples/Example/Example5_UIPickerView.swift index 7f964510..d851122e 100644 --- a/Examples/Example/Example5_UIPickerView.swift +++ b/Examples/Example/Example5_UIPickerView.swift @@ -34,9 +34,9 @@ final class ReactivePickerViewControllerExample: UIViewController { }) { (_, _, items, row, _) -> NSAttributedString? in return NSAttributedString(string: items[row], attributes: [ - NSAttributedStringKey.foregroundColor: UIColor.purple, - NSAttributedStringKey.underlineStyle: NSUnderlineStyle.styleDouble.rawValue, - NSAttributedStringKey.textEffect: NSAttributedString.TextEffectStyle.letterpressStyle + .foregroundColor: UIColor.purple, + .underlineStyle: NSUnderlineStyle.double.rawValue, + .textEffect: NSAttributedString.TextEffectStyle.letterpressStyle ]) } private let viewPickerAdapter = RxPickerViewViewAdapter<[String]>(components: [], diff --git a/Examples/Example/Support/AppDelegate.swift b/Examples/Example/Support/AppDelegate.swift index c817dce6..ae6c792f 100644 --- a/Examples/Example/Support/AppDelegate.swift +++ b/Examples/Example/Support/AppDelegate.swift @@ -13,9 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { return true } From 0e95fe30ee8aee1d822ded5541edf59deaa09bf9 Mon Sep 17 00:00:00 2001 From: antonnazarov Date: Wed, 5 Jun 2019 21:36:38 +0300 Subject: [PATCH 42/58] Added swiftlint --- .swiftlint.yml | 36 ++++ .travis.yml | 1 + Carthage/Checkouts/RxSwift | 2 +- ..._CustomizationUsingTableViewDelegate.swift | 6 +- ...Example2_RandomizedSectionsAnimation.swift | 32 ++-- .../Example/Example3_TableViewEditing.swift | 8 +- ...xample4_DifferentSectionAndItemTypes.swift | 21 +-- Examples/Example/Example5_UIPickerView.swift | 60 ++++--- .../Views/ImageTitleTableViewCell.swift | 9 +- .../Views/TitleSteperTableViewCell.swift | 14 +- .../Views/TitleSwitchTableViewCell.swift | 9 +- Examples/Example/Views/UIKitExtensions.swift | 2 +- Package.swift | 6 +- RxDataSources.xcodeproj/project.pbxproj | 22 +++ Sources/Differentiator/Changeset.swift | 22 ++- Sources/Differentiator/Diff.swift | 63 +++---- Sources/Differentiator/Utilities.swift | 2 +- Sources/RxDataSources/DataSources.swift | 2 +- .../RxDataSources/RxPickerViewAdapter.swift | 4 +- .../RxDataSources/UI+SectionedViewType.swift | 1 + Tests/RxDataSourcesTests/AlgorithmTests.swift | 160 +++++++++--------- .../ChangeSet+TestExtensions.swift | 10 +- Tests/RxDataSourcesTests/Randomizer.swift | 4 +- 23 files changed, 279 insertions(+), 217 deletions(-) create mode 100644 .swiftlint.yml diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 00000000..e5134064 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,36 @@ +excluded: + - Carthage +opt_in_rules: + - overridden_super_call + - private_outlet + - prohibited_super_call + - first_where + - closure_spacing + - unneeded_parentheses_in_closure_argument + - redundant_nil_coalescing + - pattern_matching_keywords + - explicit_init + - contains_over_first_not_nil +disabled_rules: + - line_length + - trailing_whitespace + - type_name + - identifier_name + - vertical_whitespace + - trailing_newline + - opening_brace + - large_tuple + - file_length + - comma + - colon + - private_over_fileprivate + - force_cast + - force_try + - function_parameter_count + - statement_position + - legacy_hashing + - todo + - operator_whitespace + - type_body_length + - function_body_length + - cyclomatic_complexity diff --git a/.travis.yml b/.travis.yml index f4367b1a..da7b7029 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ notifications: install: true env: + - BUILD="brew install swiftlint" - BUILD="carthage update --platform iOS && pushd Examples && set -o pipefail && (xcodebuild -project Example.xcodeproj -scheme ExampleUITests -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' test && xcodebuild -project Example.xcodeproj -scheme Example -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' build) | xcpretty" - BUILD="carthage update --platform ios && set -o pipefail && (xcodebuild -project RxDataSources.xcodeproj -scheme Tests -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' test) | xcpretty" - BUILD="gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet; pod repo update && pod lib lint RxDataSources.podspec --verbose && pod lib lint Differentiator.podspec --verbose " diff --git a/Carthage/Checkouts/RxSwift b/Carthage/Checkouts/RxSwift index b3e888b4..885637eb 160000 --- a/Carthage/Checkouts/RxSwift +++ b/Carthage/Checkouts/RxSwift @@ -1 +1 @@ -Subproject commit b3e888b4972d9bc76495dd74d30a8c7fad4b9395 +Subproject commit 885637ebe2bf9fe17e9aaf0312f5daf4e7aae632 diff --git a/Examples/Example/Example1_CustomizationUsingTableViewDelegate.swift b/Examples/Example/Example1_CustomizationUsingTableViewDelegate.swift index ec700341..9a0192f6 100644 --- a/Examples/Example/Example1_CustomizationUsingTableViewDelegate.swift +++ b/Examples/Example/Example1_CustomizationUsingTableViewDelegate.swift @@ -32,7 +32,7 @@ extension MySection : AnimatableSectionModelType { } class CustomizationUsingTableViewDelegate : UIViewController { - @IBOutlet var tableView: UITableView! + @IBOutlet private var tableView: UITableView! let disposeBag = DisposeBag() @@ -44,7 +44,7 @@ class CustomizationUsingTableViewDelegate : UIViewController { tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell") let dataSource = RxTableViewSectionedAnimatedDataSource( - configureCell: { ds, tv, ip, item in + configureCell: { ds, tv, _, item in let cell = tv.dequeueReusableCell(withIdentifier: "Cell") ?? UITableViewCell(style: .default, reuseIdentifier: "Cell") cell.textLabel?.text = "Item \(item)" @@ -83,7 +83,7 @@ extension CustomizationUsingTableViewDelegate : UITableViewDelegate { // you can also fetch item guard let item = dataSource?[indexPath], // .. or section and customize what you like - let _ = dataSource?[indexPath.section] + dataSource?[indexPath.section] != nil else { return 0.0 } diff --git a/Examples/Example/Example2_RandomizedSectionsAnimation.swift b/Examples/Example/Example2_RandomizedSectionsAnimation.swift index 513e8586..1eb6d0e2 100644 --- a/Examples/Example/Example2_RandomizedSectionsAnimation.swift +++ b/Examples/Example/Example2_RandomizedSectionsAnimation.swift @@ -13,19 +13,27 @@ import RxCocoa import CoreLocation class NumberCell : UICollectionViewCell { - @IBOutlet var value: UILabel? + @IBOutlet private var value: UILabel? + + func configure(with value: String) { + self.value?.text = value + } } class NumberSectionView : UICollectionReusableView { - @IBOutlet weak var value: UILabel? + @IBOutlet private weak var value: UILabel? + + func configure(value: String) { + self.value?.text = value + } } class PartialUpdatesViewController: UIViewController { - @IBOutlet weak var animatedTableView: UITableView! - @IBOutlet weak var tableView: UITableView! - @IBOutlet weak var animatedCollectionView: UICollectionView! - @IBOutlet weak var refreshButton: UIButton! + @IBOutlet private weak var animatedTableView: UITableView! + @IBOutlet private weak var tableView: UITableView! + @IBOutlet private weak var animatedCollectionView: UICollectionView! + @IBOutlet private weak var refreshButton: UIButton! let disposeBag = DisposeBag() @@ -96,12 +104,12 @@ extension PartialUpdatesViewController { TableViewSectionedDataSource.TitleForHeaderInSection ) { return ( - { (_, tv, ip, i) in + { _, tv, ip, i in let cell = tv.dequeueReusableCell(withIdentifier: "Cell") ?? UITableViewCell(style:.default, reuseIdentifier: "Cell") cell.textLabel!.text = "\(i)" return cell }, - { (ds, section) -> String? in + { ds, section -> String? in return ds[section].header } ) @@ -112,15 +120,15 @@ extension PartialUpdatesViewController { CollectionViewSectionedDataSource.ConfigureSupplementaryView ) { return ( - { (_, cv, ip, i) in + { _, cv, ip, i in let cell = cv.dequeueReusableCell(withReuseIdentifier: "Cell", for: ip) as! NumberCell - cell.value!.text = "\(i)" + cell.configure(with: "\(i)") return cell }, - { (ds ,cv, kind, ip) in + { ds ,cv, kind, ip in let section = cv.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "Section", for: ip) as! NumberSectionView - section.value!.text = "\(ds[ip.section].header)" + section.configure(value: "\(ds[ip.section].header)") return section } ) diff --git a/Examples/Example/Example3_TableViewEditing.swift b/Examples/Example/Example3_TableViewEditing.swift index 1b817527..db4d45c5 100644 --- a/Examples/Example/Example3_TableViewEditing.swift +++ b/Examples/Example/Example3_TableViewEditing.swift @@ -14,9 +14,9 @@ import RxCocoa // redux like editing example class EditingExampleViewController: UIViewController { - @IBOutlet weak var addButton: UIBarButtonItem! + @IBOutlet private weak var addButton: UIBarButtonItem! - @IBOutlet weak var tableView: UITableView! + @IBOutlet private weak var tableView: UITableView! let disposeBag = DisposeBag() override func viewDidLoad() { @@ -66,12 +66,12 @@ extension EditingExampleViewController { animationConfiguration: AnimationConfiguration(insertAnimation: .top, reloadAnimation: .fade, deleteAnimation: .left), - configureCell: { (dataSource, table, idxPath, item) in + configureCell: { _, table, idxPath, item in let cell = table.dequeueReusableCell(withIdentifier: "Cell", for: idxPath) cell.textLabel?.text = "\(item)" return cell }, - titleForHeaderInSection: { (ds, section) -> String? in + titleForHeaderInSection: { ds, section -> String? in return ds[section].header }, canEditRowAtIndexPath: { _, _ in diff --git a/Examples/Example/Example4_DifferentSectionAndItemTypes.swift b/Examples/Example/Example4_DifferentSectionAndItemTypes.swift index bcec6620..8946d9fa 100644 --- a/Examples/Example/Example4_DifferentSectionAndItemTypes.swift +++ b/Examples/Example/Example4_DifferentSectionAndItemTypes.swift @@ -15,7 +15,7 @@ import Differentiator // the trick is to just use enum for different section types class MultipleSectionModelViewController: UIViewController { - @IBOutlet weak var tableView: UITableView! + @IBOutlet private weak var tableView: UITableView! let disposeBag = DisposeBag() override func viewDidLoad() { @@ -41,24 +41,19 @@ class MultipleSectionModelViewController: UIViewController { extension MultipleSectionModelViewController { static func dataSource() -> RxTableViewSectionedReloadDataSource { return RxTableViewSectionedReloadDataSource( - configureCell: { (dataSource, table, idxPath, _) in + configureCell: { dataSource, table, idxPath, _ in switch dataSource[idxPath] { case let .ImageSectionItem(image, title): let cell: ImageTitleTableViewCell = table.dequeueReusableCell(forIndexPath: idxPath) - cell.titleLabel.text = title - cell.cellImageView.image = image - + cell.configure(image: image, title: title) return cell case let .StepperSectionItem(title): let cell: TitleSteperTableViewCell = table.dequeueReusableCell(forIndexPath: idxPath) - cell.titleLabel.text = title - + cell.configure(title: title) return cell case let .ToggleableSectionItem(title, enabled): let cell: TitleSwitchTableViewCell = table.dequeueReusableCell(forIndexPath: idxPath) - cell.switchControl.isOn = enabled - cell.titleLabel.text = title - + cell.configure(title: title, isEnabled: enabled) return cell } }, @@ -88,11 +83,11 @@ extension MultipleSectionModel: SectionModelType { var items: [SectionItem] { switch self { case .ImageProvidableSection(title: _, items: let items): - return items.map {$0} + return items.map { $0 } case .StepperableSection(title: _, items: let items): - return items.map {$0} + return items.map { $0 } case .ToggleableSection(title: _, items: let items): - return items.map {$0} + return items.map { $0 } } } diff --git a/Examples/Example/Example5_UIPickerView.swift b/Examples/Example/Example5_UIPickerView.swift index d851122e..2e19a28c 100644 --- a/Examples/Example/Example5_UIPickerView.swift +++ b/Examples/Example/Example5_UIPickerView.swift @@ -13,41 +13,49 @@ import RxDataSources final class ReactivePickerViewControllerExample: UIViewController { - @IBOutlet weak var firstPickerView: UIPickerView! - @IBOutlet weak var secondPickerView: UIPickerView! - @IBOutlet weak var thirdPickerView: UIPickerView! + @IBOutlet private weak var firstPickerView: UIPickerView! + @IBOutlet private weak var secondPickerView: UIPickerView! + @IBOutlet private weak var thirdPickerView: UIPickerView! let disposeBag = DisposeBag() private let stringPickerAdapter = RxPickerViewStringAdapter<[String]>(components: [], numberOfComponents: { _,_,_ in 1 }, - numberOfRowsInComponent: { (_, _, items, _) -> Int in + numberOfRowsInComponent: { _, _, items, _ -> Int in return items.count }, - titleForRow: { (_, _, items, row, _) -> String? in + titleForRow: { _, _, items, row, _ -> String? in return items[row] }) - private let attributedStringPickerAdapter = RxPickerViewAttributedStringAdapter<[String]>(components: [], - numberOfComponents: { _,_,_ in 1 }, - numberOfRowsInComponent: { (_, _, items, _) -> Int in - return items.count - }) { (_, _, items, row, _) -> NSAttributedString? in - return NSAttributedString(string: items[row], - attributes: [ - .foregroundColor: UIColor.purple, - .underlineStyle: NSUnderlineStyle.double.rawValue, - .textEffect: NSAttributedString.TextEffectStyle.letterpressStyle - ]) - } - private let viewPickerAdapter = RxPickerViewViewAdapter<[String]>(components: [], - numberOfComponents: { _,_,_ in 1 }, - numberOfRowsInComponent: { (_, _, items, _) -> Int in - return items.count - }) { (_, _, _, row, _, view) -> UIView in - let componentView = view ?? UIView() - componentView.backgroundColor = row % 2 == 0 ? UIColor.red : UIColor.blue - return componentView - } + private let attributedStringPickerAdapter = RxPickerViewAttributedStringAdapter<[String]>( + components: [], + numberOfComponents: { _,_,_ in 1 }, + numberOfRowsInComponent: { _, _, items, _ -> Int in + return items.count + }, + attributedTitleForRow: { _, _, items, row, _ -> NSAttributedString? in + NSAttributedString( + string: items[row], + attributes: [ + .foregroundColor: UIColor.purple, + .underlineStyle: NSUnderlineStyle.double.rawValue, + .textEffect: NSAttributedString.TextEffectStyle.letterpressStyle + ] + ) + } + ) + private let viewPickerAdapter = RxPickerViewViewAdapter<[String]>( + components: [], + numberOfComponents: { _,_,_ in 1 }, + numberOfRowsInComponent: { _, _, items, _ -> Int in + return items.count + }, + viewForRow: { _, _, _, row, _, view -> UIView in + let componentView = view ?? UIView() + componentView.backgroundColor = row % 2 == 0 ? UIColor.red : UIColor.blue + return componentView + } + ) override func viewDidLoad() { super.viewDidLoad() diff --git a/Examples/Example/Views/ImageTitleTableViewCell.swift b/Examples/Example/Views/ImageTitleTableViewCell.swift index a5ec3689..c47bd1a9 100644 --- a/Examples/Example/Views/ImageTitleTableViewCell.swift +++ b/Examples/Example/Views/ImageTitleTableViewCell.swift @@ -10,6 +10,11 @@ import UIKit class ImageTitleTableViewCell: UITableViewCell { - @IBOutlet weak var cellImageView: UIImageView! - @IBOutlet weak var titleLabel: UILabel! + @IBOutlet private weak var cellImageView: UIImageView! + @IBOutlet private weak var titleLabel: UILabel! + + func configure(image: UIImage, title: String) { + cellImageView.image = image + titleLabel.text = title + } } diff --git a/Examples/Example/Views/TitleSteperTableViewCell.swift b/Examples/Example/Views/TitleSteperTableViewCell.swift index 2168849e..98fea00b 100644 --- a/Examples/Example/Views/TitleSteperTableViewCell.swift +++ b/Examples/Example/Views/TitleSteperTableViewCell.swift @@ -10,17 +10,11 @@ import UIKit class TitleSteperTableViewCell: UITableViewCell { - @IBOutlet weak var stepper: UIStepper! - @IBOutlet weak var titleLabel: UILabel! - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) + @IBOutlet private weak var stepper: UIStepper! + @IBOutlet private weak var titleLabel: UILabel! - // Configure the view for the selected state + func configure(title: String) { + titleLabel.text = title } } diff --git a/Examples/Example/Views/TitleSwitchTableViewCell.swift b/Examples/Example/Views/TitleSwitchTableViewCell.swift index 8ae8734d..92952355 100644 --- a/Examples/Example/Views/TitleSwitchTableViewCell.swift +++ b/Examples/Example/Views/TitleSwitchTableViewCell.swift @@ -11,6 +11,11 @@ import UIKit class TitleSwitchTableViewCell: UITableViewCell { - @IBOutlet weak var switchControl: UISwitch! - @IBOutlet weak var titleLabel: UILabel! + @IBOutlet private weak var switchControl: UISwitch! + @IBOutlet private weak var titleLabel: UILabel! + + func configure(title: String, isEnabled: Bool) { + switchControl.isOn = isEnabled + titleLabel.text = title + } } diff --git a/Examples/Example/Views/UIKitExtensions.swift b/Examples/Example/Views/UIKitExtensions.swift index 5936b526..03263ec6 100644 --- a/Examples/Example/Views/UIKitExtensions.swift +++ b/Examples/Example/Views/UIKitExtensions.swift @@ -11,7 +11,7 @@ import class UIKit.UITableView import struct Foundation.IndexPath protocol ReusableView: class { - static var reuseIdentifier: String {get} + static var reuseIdentifier: String { get } } extension ReusableView { diff --git a/Package.swift b/Package.swift index d98b1fe3..e47abdae 100644 --- a/Package.swift +++ b/Package.swift @@ -9,15 +9,15 @@ let package = Package( ], products: [ .library(name: "RxDataSources", targets: ["RxDataSources"]), - .library(name: "Differentiator", targets: ["Differentiator"]), + .library(name: "Differentiator", targets: ["Differentiator"]) ], dependencies: [ - .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.0.0")), + .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.0.0")) ], targets: [ .target(name: "RxDataSources", dependencies: ["Differentiator", "RxSwift", "RxCocoa"]), .target(name: "Differentiator"), - .testTarget(name: "RxDataSourcesTests", dependencies: ["RxDataSources"]), + .testTarget(name: "RxDataSourcesTests", dependencies: ["RxDataSources"]) ], swiftLanguageVersions: [.v5] ) diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index fdfdf02e..5e918edb 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -412,6 +412,7 @@ isa = PBXNativeTarget; buildConfigurationList = C8984C621C36AF35001E4272 /* Build configuration list for PBXNativeTarget "RxDataSources" */; buildPhases = ( + 783D0B9C22A83BC600B15646 /* Swiftlint */, C8984C551C36AF35001E4272 /* Sources */, C8984C561C36AF35001E4272 /* Frameworks */, C8984C571C36AF35001E4272 /* Headers */, @@ -577,6 +578,27 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 783D0B9C22A83BC600B15646 /* Swiftlint */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = Swiftlint; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"SwiftLint does not exist, download from https://github.com/realm/SwiftLint\"\nfi\n\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ C81905AA1DEA019100AE679C /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/Sources/Differentiator/Changeset.swift b/Sources/Differentiator/Changeset.swift index ceb1fe0e..8eb40e90 100644 --- a/Sources/Differentiator/Changeset.swift +++ b/Sources/Differentiator/Changeset.swift @@ -27,18 +27,16 @@ public struct Changeset { public let updatedItems: [ItemPath] init(reloadData: Bool = false, - originalSections: [Section] = [], - finalSections: [Section] = [], - insertedSections: [Int] = [], - deletedSections: [Int] = [], - movedSections: [(from: Int, to: Int)] = [], - updatedSections: [Int] = [], - - insertedItems: [ItemPath] = [], - deletedItems: [ItemPath] = [], - movedItems: [(from: ItemPath, to: ItemPath)] = [], - updatedItems: [ItemPath] = [] - ) { + originalSections: [Section] = [], + finalSections: [Section] = [], + insertedSections: [Int] = [], + deletedSections: [Int] = [], + movedSections: [(from: Int, to: Int)] = [], + updatedSections: [Int] = [], + insertedItems: [ItemPath] = [], + deletedItems: [ItemPath] = [], + movedItems: [(from: ItemPath, to: ItemPath)] = [], + updatedItems: [ItemPath] = []) { self.reloadData = reloadData self.originalSections = originalSections diff --git a/Sources/Differentiator/Diff.swift b/Sources/Differentiator/Diff.swift index f5415906..3079f8d3 100644 --- a/Sources/Differentiator/Diff.swift +++ b/Sources/Differentiator/Diff.swift @@ -50,23 +50,21 @@ public enum Diff { case untouched var debugDescription: String { - get { - switch self { - case .inserted: - return "Inserted" - case .insertedAutomatically: - return "InsertedAutomatically" - case .deleted: - return "Deleted" - case .deletedAutomatically: - return "DeletedAutomatically" - case .moved: - return "Moved" - case .movedAutomatically: - return "MovedAutomatically" - case .untouched: - return "Untouched" - } + switch self { + case .inserted: + return "Inserted" + case .insertedAutomatically: + return "InsertedAutomatically" + case .deleted: + return "Deleted" + case .deletedAutomatically: + return "DeletedAutomatically" + case .moved: + return "Moved" + case .movedAutomatically: + return "MovedAutomatically" + case .untouched: + return "Untouched" } } } @@ -78,9 +76,7 @@ public enum Diff { var itemCount: Int var debugDescription: String { - get { - return "\(event), \(String(describing: indexAfterDelete))" - } + return "\(event), \(String(describing: indexAfterDelete))" } static var initial: SectionAssociatedData { @@ -94,9 +90,7 @@ public enum Diff { var moveIndex: ItemPath? var debugDescription: String { - get { - return "\(event) \(String(describing: indexAfterDelete))" - } + return "\(event) \(String(describing: indexAfterDelete))" } static var initial : ItemAssociatedData { @@ -159,7 +153,7 @@ public enum Diff { finalItemCache: ContiguousArray> ) throws -> (ContiguousArray>, ContiguousArray>) { - + // swiftlint:disable:next nesting typealias Identity = Item.Identity let totalInitialItems = initialItemCache.map { $0.count }.reduce(0, +) @@ -185,7 +179,7 @@ public enum Diff { return ContiguousArray(repeating: ItemAssociatedData.initial, count: items.count) }) - try initialIdentities.withUnsafeBufferPointer { (identitiesBuffer: UnsafeBufferPointer) -> () in + try initialIdentities.withUnsafeBufferPointer { (identitiesBuffer: UnsafeBufferPointer) -> Void in var dictionary: [OptimizedIdentity: Int] = Dictionary(minimumCapacity: totalInitialItems * 2) for i in 0 ..< initialIdentities.count { @@ -358,8 +352,6 @@ public enum Diff { initialSections: [Section], finalSections: [Section]) throws -> [Changeset
] { - typealias I = Section.Item - var result: [Changeset
] = [] var sectionCommands = try CommandGenerator
.generatorForInitialSections(initialSections, finalSections: finalSections) @@ -372,6 +364,7 @@ public enum Diff { } private struct CommandGenerator { + // swiftlint:disable:next nesting typealias Item = Section.Item let initialSections: [Section] @@ -445,7 +438,7 @@ public enum Diff { return i2 } - i2 = i2 + 1 + i2 += 1 } return nil @@ -453,7 +446,7 @@ public enum Diff { // first mark deleted items for i in 0 ..< initialItemCache.count { - guard let _ = initialSectionData[i].moveIndex else { + guard initialSectionData[i].moveIndex != nil else { continue } @@ -566,7 +559,7 @@ public enum Diff { return i } - i = i + 1 + i += 1 } return nil @@ -591,10 +584,8 @@ public enum Diff { } // inserted sections - for (i, section) in finalSectionData.enumerated() { - if section.moveIndex == nil { - _ = finalSectionData[i].event == .inserted - } + for (i, section) in finalSectionData.enumerated() where section.moveIndex == nil { + _ = finalSectionData[i].event == .inserted } return (initialSectionData, finalSectionData) @@ -639,7 +630,7 @@ public enum Diff { } } - afterDeleteState.append(try Section.init(safeOriginal: initialSections[i], safeItems: afterDeleteItems)) + afterDeleteState.append(try Section(safeOriginal: initialSections[i], safeItems: afterDeleteItems)) } // } @@ -716,7 +707,7 @@ public enum Diff { items.append(finalItemCache[finalIndex.sectionIndex][finalIndex.itemIndex]) } - let modifiedSection = try Section.init(safeOriginal: s, safeItems: items) + let modifiedSection = try Section(safeOriginal: s, safeItems: items) return modifiedSection } diff --git a/Sources/Differentiator/Utilities.swift b/Sources/Differentiator/Utilities.swift index c884f57a..7398184f 100644 --- a/Sources/Differentiator/Utilities.swift +++ b/Sources/Differentiator/Utilities.swift @@ -13,7 +13,7 @@ enum DifferentiatorError : Error { case preconditionFailed(message: String) } -func precondition(_ condition: Bool, _ message: @autoclosure() -> String) throws -> () { +func precondition(_ condition: Bool, _ message: @autoclosure() -> String) throws { if condition { return } diff --git a/Sources/RxDataSources/DataSources.swift b/Sources/RxDataSources/DataSources.swift index 0f05c189..b978e03a 100644 --- a/Sources/RxDataSources/DataSources.swift +++ b/Sources/RxDataSources/DataSources.swift @@ -14,7 +14,7 @@ enum RxDataSourceError : Error { case preconditionFailed(message: String) } -func rxPrecondition(_ condition: Bool, _ message: @autoclosure() -> String) throws -> () { +func rxPrecondition(_ condition: Bool, _ message: @autoclosure() -> String) throws { if condition { return } diff --git a/Sources/RxDataSources/RxPickerViewAdapter.swift b/Sources/RxDataSources/RxPickerViewAdapter.swift index 44261c73..d1f6ed31 100644 --- a/Sources/RxDataSources/RxPickerViewAdapter.swift +++ b/Sources/RxDataSources/RxPickerViewAdapter.swift @@ -210,7 +210,7 @@ open class RxPickerViewDataSource: NSObject, UIPickerViewDataSource private let numberOfComponents: NumberOfComponents private let numberOfRowsInComponent: NumberOfRowsInComponent - //MARK: UIPickerViewDataSource + // MARK: UIPickerViewDataSource public func numberOfComponents(in pickerView: UIPickerView) -> Int { return numberOfComponents(self, pickerView, components) @@ -223,7 +223,7 @@ open class RxPickerViewDataSource: NSObject, UIPickerViewDataSource extension RxPickerViewDataSource: RxPickerViewDataSourceType { public func pickerView(_ pickerView: UIPickerView, observedEvent: Event) { - Binder(self) { (dataSource, components) in + Binder(self) { dataSource, components in dataSource.components = components pickerView.reloadAllComponents() }.on(observedEvent) diff --git a/Sources/RxDataSources/UI+SectionedViewType.swift b/Sources/RxDataSources/UI+SectionedViewType.swift index bf4c3c24..033fc1d1 100644 --- a/Sources/RxDataSources/UI+SectionedViewType.swift +++ b/Sources/RxDataSources/UI+SectionedViewType.swift @@ -102,6 +102,7 @@ public protocol SectionedViewType { extension SectionedViewType { public func batchUpdates
(_ changes: Changeset
, animationConfiguration: AnimationConfiguration) { + // swiftlint:disable:next nesting typealias Item = Section.Item deleteSections(changes.deletedSections, animationStyle: animationConfiguration.deleteAnimation) diff --git a/Tests/RxDataSourcesTests/AlgorithmTests.swift b/Tests/RxDataSourcesTests/AlgorithmTests.swift index 3fd09223..e90a464c 100644 --- a/Tests/RxDataSourcesTests/AlgorithmTests.swift +++ b/Tests/RxDataSourcesTests/AlgorithmTests.swift @@ -22,7 +22,7 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]) ] @@ -31,7 +31,7 @@ extension AlgorithmTests { i(0, ""), i(1, ""), i(2, ""), - i(3, ""), + i(3, "") ]) ] @@ -48,14 +48,14 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]) ] let final: [s] = [ s(1, [ i(0, ""), - i(2, ""), + i(2, "") ]) ] @@ -72,7 +72,7 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]) ] @@ -80,7 +80,7 @@ extension AlgorithmTests { s(1, [ i(1, ""), i(2, ""), - i(0, ""), + i(0, "") ]) ] @@ -97,7 +97,7 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]) ] @@ -105,7 +105,7 @@ extension AlgorithmTests { s(1, [ i(2, ""), i(0, ""), - i(1, ""), + i(1, "") ]) ] @@ -122,7 +122,7 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]) ] @@ -130,7 +130,7 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, "u"), - i(2, ""), + i(2, "") ]) ] @@ -147,7 +147,7 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]) ] @@ -155,7 +155,7 @@ extension AlgorithmTests { s(1, [ i(1, "u"), i(0, ""), - i(2, ""), + i(2, "") ]) ] @@ -181,7 +181,7 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]) ] @@ -189,13 +189,13 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]), s(2, [ i(3, ""), i(4, ""), - i(5, ""), - ]), + i(5, "") + ]) ] let differences = try! Diff.differencesForSectionedView(initialSections: initial, finalSections: final) @@ -211,7 +211,7 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]) ] @@ -232,36 +232,36 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]), s(2, [ i(3, ""), i(4, ""), - i(5, ""), + i(5, "") ]), s(3, [ i(6, ""), i(7, ""), - i(8, ""), - ]), + i(8, "") + ]) ] let final: [s] = [ s(2, [ i(3, ""), i(4, ""), - i(5, ""), + i(5, "") ]), s(3, [ i(6, ""), i(7, ""), - i(8, ""), + i(8, "") ]), s(1, [ i(0, ""), i(1, ""), - i(2, ""), - ]), + i(2, "") + ]) ] let differences = try! Diff.differencesForSectionedView(initialSections: initial, finalSections: final) @@ -277,36 +277,36 @@ extension AlgorithmTests { s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]), s(2, [ i(3, ""), i(4, ""), - i(5, ""), + i(5, "") ]), s(3, [ i(6, ""), i(7, ""), - i(8, ""), - ]), + i(8, "") + ]) ] let final: [s] = [ s(3, [ i(6, ""), i(7, ""), - i(8, ""), + i(8, "") ]), s(1, [ i(0, ""), i(1, ""), - i(2, ""), + i(2, "") ]), s(2, [ i(3, ""), i(4, ""), - i(5, ""), - ]), + i(5, "") + ]) ] let differences = try! Diff.differencesForSectionedView(initialSections: initial, finalSections: final) @@ -323,21 +323,21 @@ extension AlgorithmTests { func testThrowsErrorOnDuplicateItem() { let initial: [s] = [ s(1, [ - i(1111, ""), + i(1111, "") ]), s(2, [ - i(1111, ""), - ]), + i(1111, "") + ]) ] do { _ = try Diff.differencesForSectionedView(initialSections: initial, finalSections: initial) - XCTFail() + XCTFail("Should throw exception") } catch let exception { guard case let .duplicateItem(item) = exception as! Diff.Error else { - XCTFail() + XCTFail("Not required error") return } @@ -348,26 +348,26 @@ extension AlgorithmTests { func testThrowsErrorOnDuplicateSection() { let initial: [s] = [ s(1, [ - i(1111, ""), + i(1111, "") ]), s(1, [ - i(1112, ""), - ]), + i(1112, "") + ]) ] do { _ = try Diff.differencesForSectionedView(initialSections: initial, finalSections: initial) - XCTFail() + XCTFail("Should throw exception") } catch let exception { guard case let .duplicateSection(section) = exception as! Diff.Error else { - XCTFail() + XCTFail("Not required error") return } XCTAssertEqual(section as! s, s(1, [ - i(1112, ""), + i(1112, "") ])) } } @@ -375,23 +375,23 @@ extension AlgorithmTests { func testThrowsErrorOnInvalidInitializerImplementation1() { let initial: [sInvalidInitializerImplementation1] = [ sInvalidInitializerImplementation1(1, [ - i(1111, ""), - ]), + i(1111, "") + ]) ] do { _ = try Diff.differencesForSectionedView(initialSections: initial, finalSections: initial) - XCTFail() + XCTFail("Should throw exception") } catch let exception { guard case let .invalidInitializerImplementation(section, expectedItems, identifier) = exception as! Diff.Error else { - XCTFail() + XCTFail("Not required error") return } XCTAssertEqual(section as! sInvalidInitializerImplementation1, sInvalidInitializerImplementation1(1, [ i(1111, ""), - i(1111, ""), + i(1111, "") ])) XCTAssertEqual(expectedItems as! [i], [i(1111, "")]) @@ -402,22 +402,22 @@ extension AlgorithmTests { func testThrowsErrorOnInvalidInitializerImplementation2() { let initial: [sInvalidInitializerImplementation2] = [ sInvalidInitializerImplementation2(1, [ - i(1111, ""), - ]), + i(1111, "") + ]) ] do { _ = try Diff.differencesForSectionedView(initialSections: initial, finalSections: initial) - XCTFail() + XCTFail("Should throw exception") } catch let exception { guard case let .invalidInitializerImplementation(section, expectedItems, identifier) = exception as! Diff.Error else { - XCTFail() + XCTFail("Not required error") return } XCTAssertEqual(section as! sInvalidInitializerImplementation2, sInvalidInitializerImplementation2(-1, [ - i(1111, ""), + i(1111, "") ])) XCTAssertEqual(expectedItems as! [i], [i(1111, "")]) @@ -431,20 +431,20 @@ extension AlgorithmTests { func testCase1() { let initial: [s] = [ s(1, [ - i(1111, ""), + i(1111, "") ]), s(2, [ - i(2222, ""), - ]), + i(2222, "") + ]) ] let final: [s] = [ s(2, [ - i(0, "1"), + i(0, "1") ]), s(1, [ - ]), + ]) ] let differences = try! Diff.differencesForSectionedView(initialSections: initial, finalSections: final) @@ -457,13 +457,13 @@ extension AlgorithmTests { s(4, [ i(10, ""), i(11, ""), - i(12, ""), + i(12, "") ]), s(9, [ i(25, ""), i(26, ""), - i(27, ""), - ]), + i(27, "") + ]) ] @@ -471,12 +471,12 @@ extension AlgorithmTests { s(9, [ i(11, "u"), i(26, ""), - i(27, "u"), + i(27, "u") ]), s(4, [ i(10, "u"), - i(12, ""), - ]), + i(12, "") + ]) ] @@ -488,25 +488,25 @@ extension AlgorithmTests { func testCase3() { let initial: [s] = [ s(4, [ - i(5, ""), + i(5, "") ]), s(6, [ i(20, ""), - i(14, ""), + i(14, "") ]), s(9, [ ]), s(2, [ i(2, ""), - i(26, ""), + i(26, "") ]), s(8, [ - i(23, ""), + i(23, "") ]), s(10, [ i(8, ""), i(18, ""), - i(13, ""), + i(13, "") ]), s(1, [ i(28, ""), @@ -517,37 +517,37 @@ extension AlgorithmTests { i(29, ""), i(24, ""), i(7, ""), - i(19, ""), - ]), + i(19, "") + ]) ] let final: [s] = [ s(4, [ - i(5, ""), + i(5, "") ]), s(6, [ i(20, "u"), - i(14, ""), + i(14, "") ]), s(9, [ - i(16, "u"), + i(16, "u") ]), s(7, [ i(17, ""), i(15, ""), - i(4, "u"), + i(4, "u") ]), s(2, [ i(2, ""), i(26, "u"), - i(23, "u"), + i(23, "u") ]), s(8, [ ]), s(10, [ i(8, "u"), i(18, "u"), - i(13, "u"), + i(13, "u") ]), s(1, [ i(28, "u"), @@ -558,8 +558,8 @@ extension AlgorithmTests { i(29, "u"), i(24, "u"), i(7, "u"), - i(19, "u"), - ]), + i(19, "u") + ]) ] diff --git a/Tests/RxDataSourcesTests/ChangeSet+TestExtensions.swift b/Tests/RxDataSourcesTests/ChangeSet+TestExtensions.swift index b9fc05e6..9a0695aa 100644 --- a/Tests/RxDataSourcesTests/ChangeSet+TestExtensions.swift +++ b/Tests/RxDataSourcesTests/ChangeSet+TestExtensions.swift @@ -15,7 +15,7 @@ fileprivate class ItemModelTypeWrapper { var deleted: Bool = false var updated: Bool = false - var moved: IndexPath? = nil + var moved: IndexPath? init(item: I) { self.item = item @@ -25,7 +25,7 @@ fileprivate class ItemModelTypeWrapper { fileprivate class SectionModelTypeWrapper { var updated: Bool = false var deleted: Bool = false - var moved: Int? = nil + var moved: Int? var items: [ItemModelTypeWrapper] @@ -114,10 +114,8 @@ extension Changeset { for (sectionIndex, section) in resultAfterDeletesAndUpdates.enumerated() { section.items = section.items.filter { !$0.deleted } - for (itemIndex, item) in section.items.enumerated() { - if item.updated { - section.items[itemIndex] = ItemModelTypeWrapper(item: finalSections[sectionIndex].items[itemIndex]) - } + for (itemIndex, item) in section.items.enumerated() where item.updated { + section.items[itemIndex] = ItemModelTypeWrapper(item: finalSections[sectionIndex].items[itemIndex]) } } diff --git a/Tests/RxDataSourcesTests/Randomizer.swift b/Tests/RxDataSourcesTests/Randomizer.swift index 7012fdd0..1bb79944 100644 --- a/Tests/RxDataSourcesTests/Randomizer.swift +++ b/Tests/RxDataSourcesTests/Randomizer.swift @@ -21,8 +21,8 @@ struct PseudoRandomGenerator { } func get_random() -> (PseudoRandomGenerator, Int) { - let m_z = 36969 &* (self.m_z & 65535) &+ (self.m_z >> 16); - let m_w = 18000 &* (self.m_w & 65535) &+ (self.m_w >> 16); + let m_z = 36969 &* (self.m_z & 65535) &+ (self.m_z >> 16) + let m_w = 18000 &* (self.m_w & 65535) &+ (self.m_w >> 16) let val = ((m_z << 16) &+ m_w) return (PseudoRandomGenerator(m_w, m_z), Int(val % (1 << 30))) /* 32-bit result */ } From 3ac203383af55fc440b7a2c34997b3a7e3193aa9 Mon Sep 17 00:00:00 2001 From: 432daiki Date: Thu, 21 Nov 2019 12:49:37 +0900 Subject: [PATCH 43/58] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb441c74..8e5eadaa 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ dataSource.titleForHeaderInSection = { dataSource, index in return dataSource.sectionModels[index].header } -dataSource.titleForFooterInSection = { dataSource, indexPath in +dataSource.titleForFooterInSection = { dataSource, index in return dataSource.sectionModels[index].footer } From cd5b6bdbfbb8e9db072cd0e2f01397464e51fff8 Mon Sep 17 00:00:00 2001 From: Fumiya Yamanaka Date: Mon, 30 Mar 2020 20:48:03 +0900 Subject: [PATCH 44/58] Update README.md --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index bb441c74..a5ee20b0 100644 --- a/README.md +++ b/README.md @@ -168,3 +168,20 @@ Cartfile ``` github "RxSwiftCommunity/RxDataSources" ~> 4.0 ``` + +### Swift Package Manager + +Create a `Package.swift` file. + +```swift +import PackageDescription + +let package = Package( + name: "SampleProject", + dependencies: [ + .Package(url: "https://github.com/RxSwiftCommunity/RxDataSources.git" from: "4.0.0") + ] +) +``` + +If you are using Xcode 11 or higher, go to **File / Swift Packages / Add Package Dependency...** and enter package repository URL **https://github.com/RxSwiftCommunity/RxDataSources.git**, then follow the instructions. From d8b0b6bd49797e0777bbdacb7aecbfca2b0f916c Mon Sep 17 00:00:00 2001 From: Mikhail Markin Date: Thu, 9 Jul 2020 23:25:21 +0300 Subject: [PATCH 45/58] Adding support of mutable CellViewModels Diff update: in case if moved items are equal, initial item is used for afterDeleteItems instead of final item. This allows to keep CellViewModel assigned to UICell. --- CHANGELOG.md | 2 ++ Sources/Differentiator/Diff.swift | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d11e7f6b..566cf1b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. #### Master +* Added support of mutable CellViewModels. + ## [4.0.1](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/4.0.1) * Fixes Carthage integration and reverts static frameworks to dynamic frameworks. diff --git a/Sources/Differentiator/Diff.swift b/Sources/Differentiator/Diff.swift index 3079f8d3..7e4b8712 100644 --- a/Sources/Differentiator/Diff.swift +++ b/Sources/Differentiator/Diff.swift @@ -623,8 +623,10 @@ public enum Diff { let finalItem = finalItemCache[finalItemIndex.sectionIndex][finalItemIndex.itemIndex] if finalItem != initialSections[i].items[j] { updatedItems.append(ItemPath(sectionIndex: i, itemIndex: j)) + afterDeleteItems.append(finalItem) + } else { + afterDeleteItems.append(initialSections[i].items[j]) } - afterDeleteItems.append(finalItem) default: try precondition(false, "Unhandled case") } From b736608a3845ddd8dff690fa14801e2c2739ccec Mon Sep 17 00:00:00 2001 From: Mikhail Markin Date: Fri, 10 Jul 2020 20:44:49 +0300 Subject: [PATCH 46/58] TravisCI job fixed Removed --no-rdoc --no-ri options from gem install command as long as these options do not exist and fail this job. osx_image set to xcode11.5 Test device set to iPhone 8 --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index da7b7029..97e32804 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: objective-c -osx_image: xcode10.2 +osx_image: xcode11.5 notifications: slack: rxswift:3ykt2Z61f8GkdvhCZTYPduOL @@ -10,9 +10,9 @@ install: true env: - BUILD="brew install swiftlint" - - BUILD="carthage update --platform iOS && pushd Examples && set -o pipefail && (xcodebuild -project Example.xcodeproj -scheme ExampleUITests -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' test && xcodebuild -project Example.xcodeproj -scheme Example -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' build) | xcpretty" - - BUILD="carthage update --platform ios && set -o pipefail && (xcodebuild -project RxDataSources.xcodeproj -scheme Tests -configuration Release -destination 'platform=iOS Simulator,name=iPhone 7' test) | xcpretty" - - BUILD="gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet; pod repo update && pod lib lint RxDataSources.podspec --verbose && pod lib lint Differentiator.podspec --verbose " + - BUILD="carthage update --platform iOS && pushd Examples && set -o pipefail && (xcodebuild -project Example.xcodeproj -scheme ExampleUITests -configuration Release -destination 'platform=iOS Simulator,name=iPhone 8' test && xcodebuild -project Example.xcodeproj -scheme Example -configuration Release -destination 'platform=iOS Simulator,name=iPhone 8' build) | xcpretty" + - BUILD="carthage update --platform iOS && set -o pipefail && (xcodebuild -project RxDataSources.xcodeproj -scheme Tests -configuration Release -destination 'platform=iOS Simulator,name=iPhone 8' test) | xcpretty" + - BUILD="gem install cocoapods --pre --no-document --quiet; pod repo update && pod lib lint RxDataSources.podspec --verbose && pod lib lint Differentiator.podspec --verbose " - BUILD="carthage update --platform iOS && carthage build --no-skip-current --platform iOS" - BUILD="carthage update --platform tvOS && carthage build --no-skip-current --platform tvOS" - BUILD="swift test" From 257803094c06204949b84829e511f358e761add8 Mon Sep 17 00:00:00 2001 From: yuraoff Date: Wed, 30 Sep 2020 12:55:50 +0500 Subject: [PATCH 47/58] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37b60734..cb9cc6e7 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ import PackageDescription let package = Package( name: "SampleProject", dependencies: [ - .Package(url: "https://github.com/RxSwiftCommunity/RxDataSources.git" from: "4.0.0") + .package(url: "https://github.com/RxSwiftCommunity/RxDataSources.git", from: "4.0.0") ] ) ``` From deb4d1f8892caccfd132a040374dbfb9bdc4583b Mon Sep 17 00:00:00 2001 From: Sascha Gordner Date: Mon, 23 Nov 2020 23:00:59 +0100 Subject: [PATCH 48/58] Align default closures with default behavior of the delegate methods --- Sources/RxDataSources/TableViewSectionedDataSource.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/RxDataSources/TableViewSectionedDataSource.swift b/Sources/RxDataSources/TableViewSectionedDataSource.swift index 1bd4017b..91f5ddab 100644 --- a/Sources/RxDataSources/TableViewSectionedDataSource.swift +++ b/Sources/RxDataSources/TableViewSectionedDataSource.swift @@ -37,8 +37,8 @@ open class TableViewSectionedDataSource configureCell: @escaping ConfigureCell, titleForHeaderInSection: @escaping TitleForHeaderInSection = { _, _ in nil }, titleForFooterInSection: @escaping TitleForFooterInSection = { _, _ in nil }, - canEditRowAtIndexPath: @escaping CanEditRowAtIndexPath = { _, _ in false }, - canMoveRowAtIndexPath: @escaping CanMoveRowAtIndexPath = { _, _ in false }, + canEditRowAtIndexPath: @escaping CanEditRowAtIndexPath = { _, _ in true }, + canMoveRowAtIndexPath: @escaping CanMoveRowAtIndexPath = { _, _ in true }, sectionIndexTitles: @escaping SectionIndexTitles = { _ in nil }, sectionForSectionIndexTitle: @escaping SectionForSectionIndexTitle = { _, _, index in index } ) { @@ -55,8 +55,8 @@ open class TableViewSectionedDataSource configureCell: @escaping ConfigureCell, titleForHeaderInSection: @escaping TitleForHeaderInSection = { _, _ in nil }, titleForFooterInSection: @escaping TitleForFooterInSection = { _, _ in nil }, - canEditRowAtIndexPath: @escaping CanEditRowAtIndexPath = { _, _ in false }, - canMoveRowAtIndexPath: @escaping CanMoveRowAtIndexPath = { _, _ in false } + canEditRowAtIndexPath: @escaping CanEditRowAtIndexPath = { _, _ in true }, + canMoveRowAtIndexPath: @escaping CanMoveRowAtIndexPath = { _, _ in true } ) { self.configureCell = configureCell self.titleForHeaderInSection = titleForHeaderInSection From 9c435eff9a966845df7383a95d60729fdf1680a8 Mon Sep 17 00:00:00 2001 From: Sascha Gordner Date: Tue, 24 Nov 2020 07:45:42 +0100 Subject: [PATCH 49/58] Update CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 566cf1b3..343c9d30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ All notable changes to this project will be documented in this file. #### Master -* Added support of mutable CellViewModels. +* Adds support of mutable CellViewModels. +* Changes `TableViewSectionedDataSource` default parameters `canEditRowAtIndexPath` and `canMoveRowAtIndexPath` to align with iOS default behavior #383 ## [4.0.1](https://github.com/RxSwiftCommunity/RxDataSources/releases/tag/4.0.1) From df79a7c0f00187f10adace9366392d82b3c21666 Mon Sep 17 00:00:00 2001 From: freak4pc Date: Sat, 26 Dec 2020 22:34:52 +0200 Subject: [PATCH 50/58] RxDataSources 5.0.0 --- Cartfile | 2 +- Cartfile.resolved | 1 - Carthage/Checkouts/RxSwift | 1 - Differentiator.podspec | 6 +- Package.swift | 4 +- RxDataSources.podspec | 10 +- RxDataSources.xcodeproj/project.pbxproj | 177 +++++++++++------- .../contents.xcworkspacedata | 2 +- .../xcshareddata/swiftpm/Package.resolved | 16 ++ .../xcschemes/Differentiator.xcscheme | 6 +- .../xcschemes/RxDataSources.xcscheme | 6 +- .../xcshareddata/xcschemes/Tests.xcscheme | 6 +- .../CollectionViewSectionedDataSource.swift | 5 + Sources/RxDataSources/DataSources.swift | 3 +- .../TableViewSectionedDataSource.swift | 5 + 15 files changed, 150 insertions(+), 100 deletions(-) delete mode 100644 Cartfile.resolved delete mode 160000 Carthage/Checkouts/RxSwift create mode 100644 RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/Cartfile b/Cartfile index 6a8bfd62..bcb35918 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "ReactiveX/RxSwift" ~> 5.0 +github "ReactiveX/RxSwift" ~> 6.0 diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index b751e3d5..00000000 --- a/Cartfile.resolved +++ /dev/null @@ -1 +0,0 @@ -github "ReactiveX/RxSwift" "5.0.1" diff --git a/Carthage/Checkouts/RxSwift b/Carthage/Checkouts/RxSwift deleted file mode 160000 index 885637eb..00000000 --- a/Carthage/Checkouts/RxSwift +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 885637ebe2bf9fe17e9aaf0312f5daf4e7aae632 diff --git a/Differentiator.podspec b/Differentiator.podspec index 32849a82..00760e90 100644 --- a/Differentiator.podspec +++ b/Differentiator.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Differentiator" - s.version = "4.0.1" + s.version = "5.0.0" s.summary = "Diff algorithm for UITableView and UICollectionView." s.description = <<-DESC Diff algorithm for UITableView and UICollectionView. @@ -12,12 +12,12 @@ Pod::Spec.new do |s| s.author = { "Krunoslav Zaher" => "krunoslav.zaher@gmail.com" } s.source = { :git => "https://github.com/RxSwiftCommunity/RxDataSources.git", :tag => s.version.to_s } - s.requires_arc = true + s.requires_arc = true s.swift_version = '5.0' s.source_files = 'Sources/Differentiator/**/*.swift' - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '9.0' s.tvos.deployment_target = '9.0' end diff --git a/Package.swift b/Package.swift index e47abdae..ba7f6849 100644 --- a/Package.swift +++ b/Package.swift @@ -5,14 +5,14 @@ import PackageDescription let package = Package( name: "RxDataSources", platforms: [ - .iOS(.v8), .tvOS(.v9) + .iOS(.v9), .tvOS(.v9) ], products: [ .library(name: "RxDataSources", targets: ["RxDataSources"]), .library(name: "Differentiator", targets: ["Differentiator"]) ], dependencies: [ - .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.0.0")) + .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.0.0")) ], targets: [ .target(name: "RxDataSources", dependencies: ["Differentiator", "RxSwift", "RxCocoa"]), diff --git a/RxDataSources.podspec b/RxDataSources.podspec index 2115ffc8..e0107853 100644 --- a/RxDataSources.podspec +++ b/RxDataSources.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxDataSources" - s.version = "4.0.1" + s.version = "5.0.0" s.summary = "This is a collection of reactive data sources for UITableView and UICollectionView." s.description = <<-DESC This is a collection of reactive data sources for UITableView and UICollectionView. @@ -37,11 +37,11 @@ data s.swift_version = '5.0' s.source_files = 'Sources/RxDataSources/**/*.swift' - s.dependency 'Differentiator', '~> 4.0' - s.dependency 'RxSwift', '~> 5.0' - s.dependency 'RxCocoa', '~> 5.0' + s.dependency 'Differentiator', '~> 5.0' + s.dependency 'RxSwift', '~> 6.0' + s.dependency 'RxCocoa', '~> 6.0' - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '9.0' s.tvos.deployment_target = '9.0' end diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index 5e918edb..ee015f9c 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -15,8 +15,9 @@ 03EEEE961F5B7D71006068BC /* Randomizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE851F5B7D5C006068BC /* Randomizer.swift */; }; 03EEEE971F5B7D71006068BC /* s.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE861F5B7D5C006068BC /* s.swift */; }; 03EEEE981F5B7D71006068BC /* XCTest+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE871F5B7D5C006068BC /* XCTest+Extensions.swift */; }; - 80FB1F5C228489FF009D6516 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F48228489EC009D6516 /* RxSwift.framework */; }; - 80FB1F5D22848A0E009D6516 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F4A228489EC009D6516 /* RxCocoa.framework */; }; + A2B2B506259938BD00B45031 /* RxRelay in Frameworks */ = {isa = PBXBuildFile; productRef = A2B2B505259938BD00B45031 /* RxRelay */; }; + A2B2B508259938BD00B45031 /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = A2B2B507259938BD00B45031 /* RxSwift */; }; + A2B2B50A259938BD00B45031 /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = A2B2B509259938BD00B45031 /* RxCocoa */; }; C81FBF461F3B9CED0094061E /* Differentiator.podspec in Resources */ = {isa = PBXBuildFile; fileRef = C81FBF451F3B9CED0094061E /* Differentiator.podspec */; }; C81FBF5E1F3B9D660094061E /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81FBF5B1F3B9D4C0094061E /* Array+Extensions.swift */; }; C81FBF601F3B9D8B0094061E /* FloatingPointType+IdentifiableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81FBF5F1F3B9D8B0094061E /* FloatingPointType+IdentifiableType.swift */; }; @@ -206,8 +207,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 80FB1F5D22848A0E009D6516 /* RxCocoa.framework in Frameworks */, - 80FB1F5C228489FF009D6516 /* RxSwift.framework in Frameworks */, + A2B2B506259938BD00B45031 /* RxRelay in Frameworks */, + A2B2B50A259938BD00B45031 /* RxCocoa in Frameworks */, + A2B2B508259938BD00B45031 /* RxSwift in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -424,6 +426,11 @@ C82C3C9B1F3B93D200309AE8 /* PBXTargetDependency */, ); name = RxDataSources; + packageProductDependencies = ( + A2B2B505259938BD00B45031 /* RxRelay */, + A2B2B507259938BD00B45031 /* RxSwift */, + A2B2B509259938BD00B45031 /* RxCocoa */, + ); productName = RxDataSources; productReference = C8984C5A1C36AF35001E4272 /* RxDataSources.framework */; productType = "com.apple.product-type.framework"; @@ -435,7 +442,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0810; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1230; ORGANIZATIONNAME = kzaher; TargetAttributes = { C81905AD1DEA019100AE679C = { @@ -461,6 +468,9 @@ Base, ); mainGroup = C8984C501C36AF35001E4272; + packageReferences = ( + A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */, + ); productRefGroup = C8984C5B1C36AF35001E4272 /* Products */; projectDirPath = ""; projectReferences = ( @@ -678,8 +688,12 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; DEVELOPMENT_TEAM = 783T66X79Y; INFOPLIST_FILE = Tests/RxDataSourcesTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = io.rx.Tests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; @@ -695,11 +709,16 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; DEVELOPMENT_TEAM = 783T66X79Y; INFOPLIST_FILE = Tests/RxDataSourcesTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = io.rx.Tests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; }; name = Release; }; @@ -717,7 +736,11 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Sources/Differentiator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = org.rxswiftcommunity.Differentiator; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -740,12 +763,17 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Sources/Differentiator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = org.rxswiftcommunity.Differentiator; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; }; name = Release; }; @@ -771,6 +799,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -782,26 +811,10 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - "FRAMEWORK_SEARCH_PATHS[sdk=appletvos*]" = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", - "$(PROJECT_DIR)/Carthage/Build/tvOS/", - ); - "FRAMEWORK_SEARCH_PATHS[sdk=appletvsimulator*]" = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", - "$(PROJECT_DIR)/Carthage/Build/tvOS/", - ); - "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS/Static", - "$(PROJECT_DIR)/Carthage/Build/iOS/", - ); - "FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS/Static", - "$(PROJECT_DIR)/Carthage/Build/iOS/", - ); + "FRAMEWORK_SEARCH_PATHS[sdk=appletvos*]" = "$(inherited)"; + "FRAMEWORK_SEARCH_PATHS[sdk=appletvsimulator*]" = "$(inherited)"; + "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = "$(inherited)"; + "FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = "$(inherited)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -816,11 +829,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - "LD_RUNPATH_SEARCH_PATHS[sdk=appletvos*]" = "$(inherited) $(PROJECT_DIR)/Carthage/Build/tvOS"; - "LD_RUNPATH_SEARCH_PATHS[sdk=appletvsimulator*]" = "$(inherited) $(PROJECT_DIR)/Carthage/Build/tvOS"; - "LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*]" = "$(inherited) $(PROJECT_DIR)/Carthage/Build/iOS"; - "LD_RUNPATH_SEARCH_PATHS[sdk=iphonesimulator*]" = "$(inherited) $(PROJECT_DIR)/Carthage/Build/iOS"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + "LD_RUNPATH_SEARCH_PATHS[sdk=appletvos*]" = "$(inherited)"; + "LD_RUNPATH_SEARCH_PATHS[sdk=appletvsimulator*]" = "$(inherited)"; + "LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*]" = "$(inherited)"; + "LD_RUNPATH_SEARCH_PATHS[sdk=iphonesimulator*]" = "$(inherited)"; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -829,7 +842,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 12.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -858,6 +871,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -869,26 +883,10 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - "FRAMEWORK_SEARCH_PATHS[sdk=appletvos*]" = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", - "$(PROJECT_DIR)/Carthage/Build/tvOS/", - ); - "FRAMEWORK_SEARCH_PATHS[sdk=appletvsimulator*]" = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS/Static", - "$(PROJECT_DIR)/Carthage/Build/tvOS/", - ); - "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS/Static", - "$(PROJECT_DIR)/Carthage/Build/iOS/", - ); - "FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS/Static", - "$(PROJECT_DIR)/Carthage/Build/iOS/", - ); + "FRAMEWORK_SEARCH_PATHS[sdk=appletvos*]" = "$(inherited)"; + "FRAMEWORK_SEARCH_PATHS[sdk=appletvsimulator*]" = "$(inherited)"; + "FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = "$(inherited)"; + "FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = "$(inherited)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -897,19 +895,20 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - "LD_RUNPATH_SEARCH_PATHS[sdk=appletvos*]" = "$(inherited) $(PROJECT_DIR)/Carthage/Build/tvOS"; - "LD_RUNPATH_SEARCH_PATHS[sdk=appletvsimulator*]" = "$(inherited) $(PROJECT_DIR)/Carthage/Build/tvOS"; - "LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*]" = "$(inherited) $(PROJECT_DIR)/Carthage/Build/iOS"; - "LD_RUNPATH_SEARCH_PATHS[sdk=iphonesimulator*]" = "$(inherited) $(PROJECT_DIR)/Carthage/Build/iOS"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + "LD_RUNPATH_SEARCH_PATHS[sdk=appletvos*]" = "$(inherited)"; + "LD_RUNPATH_SEARCH_PATHS[sdk=appletvsimulator*]" = "$(inherited)"; + "LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*]" = "$(inherited)"; + "LD_RUNPATH_SEARCH_PATHS[sdk=iphonesimulator*]" = "$(inherited)"; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; OTHER_SWIFT_FLAGS = ""; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 12.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -928,7 +927,11 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Sources/RxDataSources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = kzaher.RxDataSources; PRODUCT_NAME = RxDataSources; SKIP_INSTALL = YES; @@ -947,12 +950,17 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Sources/RxDataSources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = kzaher.RxDataSources; PRODUCT_NAME = RxDataSources; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; }; name = Release; }; @@ -996,6 +1004,35 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/ReactiveX/RxSwift"; + requirement = { + branch = rxswift6; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + A2B2B505259938BD00B45031 /* RxRelay */ = { + isa = XCSwiftPackageProductDependency; + package = A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */; + productName = RxRelay; + }; + A2B2B507259938BD00B45031 /* RxSwift */ = { + isa = XCSwiftPackageProductDependency; + package = A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */; + productName = RxSwift; + }; + A2B2B509259938BD00B45031 /* RxCocoa */ = { + isa = XCSwiftPackageProductDependency; + package = A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */; + productName = RxCocoa; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = C8984C511C36AF35001E4272 /* Project object */; } diff --git a/RxDataSources.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/RxDataSources.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 9e63a231..919434a6 100644 --- a/RxDataSources.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/RxDataSources.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..77794656 --- /dev/null +++ b/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "RxSwift", + "repositoryURL": "https://github.com/ReactiveX/RxSwift", + "state": { + "branch": "rxswift6", + "revision": "4e5f359d1313fa6fac816ab309431c214d706faa", + "version": null + } + } + ] + }, + "version": 1 +} diff --git a/RxDataSources.xcodeproj/xcshareddata/xcschemes/Differentiator.xcscheme b/RxDataSources.xcodeproj/xcshareddata/xcschemes/Differentiator.xcscheme index aff9d870..2e091398 100644 --- a/RxDataSources.xcodeproj/xcshareddata/xcschemes/Differentiator.xcscheme +++ b/RxDataSources.xcodeproj/xcshareddata/xcschemes/Differentiator.xcscheme @@ -1,6 +1,6 @@ - - - - - - - - - - - - } open func model(at indexPath: IndexPath) throws -> Any { + guard indexPath.section < self._sectionModels.count, + indexPath.item < self._sectionModels[indexPath.section].items.count else { + throw RxDataSourceError.outOfBounds(indexPath: indexPath) + } + return self[indexPath] } diff --git a/Sources/RxDataSources/DataSources.swift b/Sources/RxDataSources/DataSources.swift index b978e03a..25b10c60 100644 --- a/Sources/RxDataSources/DataSources.swift +++ b/Sources/RxDataSources/DataSources.swift @@ -10,8 +10,9 @@ import Foundation @_exported import Differentiator -enum RxDataSourceError : Error { +enum RxDataSourceError: Error { case preconditionFailed(message: String) + case outOfBounds(indexPath: IndexPath) } func rxPrecondition(_ condition: Bool, _ message: @autoclosure() -> String) throws { diff --git a/Sources/RxDataSources/TableViewSectionedDataSource.swift b/Sources/RxDataSources/TableViewSectionedDataSource.swift index 91f5ddab..0ba1558a 100644 --- a/Sources/RxDataSources/TableViewSectionedDataSource.swift +++ b/Sources/RxDataSources/TableViewSectionedDataSource.swift @@ -109,6 +109,11 @@ open class TableViewSectionedDataSource } open func model(at indexPath: IndexPath) throws -> Any { + guard indexPath.section < self._sectionModels.count, + indexPath.item < self._sectionModels[indexPath.section].items.count else { + throw RxDataSourceError.outOfBounds(indexPath: indexPath) + } + return self[indexPath] } From 241c62e7b578b2346c8b60efdf31b4eb2eab2966 Mon Sep 17 00:00:00 2001 From: freak4pc Date: Sat, 2 Jan 2021 11:40:03 +0200 Subject: [PATCH 51/58] Switch to main --- CHANGELOG.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 343c9d30..01f9b575 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. --- -#### Master +#### Unreleased * Adds support of mutable CellViewModels. * Changes `TableViewSectionedDataSource` default parameters `canEditRowAtIndexPath` and `canMoveRowAtIndexPath` to align with iOS default behavior #383 diff --git a/README.md b/README.md index cb9cc6e7..e6edf9e4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Travis CI](https://travis-ci.org/RxSwiftCommunity/RxDataSources.svg?branch=master)](https://travis-ci.org/RxSwiftCommunity/RxDataSources) +[![Travis CI](https://travis-ci.org/RxSwiftCommunity/RxDataSources.svg?branch=main)](https://travis-ci.org/RxSwiftCommunity/RxDataSources) Table and Collection view data sources ====================================== From 98ae6d937f37766187f97cd066076fa7127cff01 Mon Sep 17 00:00:00 2001 From: David Harris Date: Thu, 7 Jan 2021 14:03:05 -0500 Subject: [PATCH 52/58] chore: fix Carthage submodule structure and SPM xcodeproj structure --- .gitignore | 1 + .gitmodules | 2 +- Cartfile.resolved | 1 + Carthage/Checkouts/RxSwift | 1 + Package.resolved | 16 ++++++++++++++++ Package.swift | 2 +- RxDataSources.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 6 +++--- 8 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 Cartfile.resolved create mode 160000 Carthage/Checkouts/RxSwift create mode 100644 Package.resolved diff --git a/.gitignore b/.gitignore index 080b743f..94b84e3a 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ Carthage/Build .build/ Packages/ +.swiftpm/ diff --git a/.gitmodules b/.gitmodules index 293c9c47..b672b015 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "Carthage/Checkouts/RxSwift"] - path = Carthage/Checkouts/RxSwift url = https://github.com/ReactiveX/RxSwift.git + path = Carthage/Checkouts/RxSwift diff --git a/Cartfile.resolved b/Cartfile.resolved new file mode 100644 index 00000000..c07923a0 --- /dev/null +++ b/Cartfile.resolved @@ -0,0 +1 @@ +github "ReactiveX/RxSwift" "6.0.0" diff --git a/Carthage/Checkouts/RxSwift b/Carthage/Checkouts/RxSwift new file mode 160000 index 00000000..c8742ed9 --- /dev/null +++ b/Carthage/Checkouts/RxSwift @@ -0,0 +1 @@ +Subproject commit c8742ed97fc2f0c015a5ea5eddefb064cd7532d2 diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 00000000..c6207994 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "RxSwift", + "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", + "state": { + "branch": null, + "revision": "c8742ed97fc2f0c015a5ea5eddefb064cd7532d2", + "version": "6.0.0" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift index ba7f6849..eba9c8bb 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.1 import PackageDescription diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index ee015f9c..bbcb4831 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -1010,8 +1010,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/ReactiveX/RxSwift"; requirement = { - branch = rxswift6; - kind = branch; + kind = upToNextMajorVersion; + minimumVersion = 6.0.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 77794656..6451daaf 100644 --- a/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,9 +5,9 @@ "package": "RxSwift", "repositoryURL": "https://github.com/ReactiveX/RxSwift", "state": { - "branch": "rxswift6", - "revision": "4e5f359d1313fa6fac816ab309431c214d706faa", - "version": null + "branch": null, + "revision": "c8742ed97fc2f0c015a5ea5eddefb064cd7532d2", + "version": "6.0.0" } } ] From e4627ac4f5a8dc10719030561801825c443acfec Mon Sep 17 00:00:00 2001 From: David Harris Date: Fri, 8 Jan 2021 15:58:16 -0500 Subject: [PATCH 53/58] chore: fix xcodeproj builds by not using SwiftPM linking --- .swiftlint.yml | 5 ++- CHANGELOG.md | 1 + RxDataSources.xcodeproj/project.pbxproj | 43 ++----------------- .../xcshareddata/swiftpm/Package.resolved | 16 ------- 4 files changed, 8 insertions(+), 57 deletions(-) delete mode 100644 RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/.swiftlint.yml b/.swiftlint.yml index e5134064..8e5f215f 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,5 +1,6 @@ -excluded: - - Carthage +included: + - Sources + - Tests opt_in_rules: - overridden_super_call - private_outlet diff --git a/CHANGELOG.md b/CHANGELOG.md index 01f9b575..26bc1aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. #### Unreleased +* Fixes xcodeproj and submodule structure to avoid duplicate symbols and properly build for Carthage #392 * Adds support of mutable CellViewModels. * Changes `TableViewSectionedDataSource` default parameters `canEditRowAtIndexPath` and `canMoveRowAtIndexPath` to align with iOS default behavior #383 diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index bbcb4831..ed3e50a4 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -15,9 +15,8 @@ 03EEEE961F5B7D71006068BC /* Randomizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE851F5B7D5C006068BC /* Randomizer.swift */; }; 03EEEE971F5B7D71006068BC /* s.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE861F5B7D5C006068BC /* s.swift */; }; 03EEEE981F5B7D71006068BC /* XCTest+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE871F5B7D5C006068BC /* XCTest+Extensions.swift */; }; - A2B2B506259938BD00B45031 /* RxRelay in Frameworks */ = {isa = PBXBuildFile; productRef = A2B2B505259938BD00B45031 /* RxRelay */; }; - A2B2B508259938BD00B45031 /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = A2B2B507259938BD00B45031 /* RxSwift */; }; - A2B2B50A259938BD00B45031 /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = A2B2B509259938BD00B45031 /* RxCocoa */; }; + 70C0622425A8FE3D002A57ED /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F48228489EC009D6516 /* RxSwift.framework */; platformFilter = ios; }; + 70C0623425A8FE54002A57ED /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F4A228489EC009D6516 /* RxCocoa.framework */; platformFilter = ios; }; C81FBF461F3B9CED0094061E /* Differentiator.podspec in Resources */ = {isa = PBXBuildFile; fileRef = C81FBF451F3B9CED0094061E /* Differentiator.podspec */; }; C81FBF5E1F3B9D660094061E /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81FBF5B1F3B9D4C0094061E /* Array+Extensions.swift */; }; C81FBF601F3B9D8B0094061E /* FloatingPointType+IdentifiableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81FBF5F1F3B9D8B0094061E /* FloatingPointType+IdentifiableType.swift */; }; @@ -207,9 +206,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A2B2B506259938BD00B45031 /* RxRelay in Frameworks */, - A2B2B50A259938BD00B45031 /* RxCocoa in Frameworks */, - A2B2B508259938BD00B45031 /* RxSwift in Frameworks */, + 70C0623425A8FE54002A57ED /* RxCocoa.framework in Frameworks */, + 70C0622425A8FE3D002A57ED /* RxSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -427,9 +425,6 @@ ); name = RxDataSources; packageProductDependencies = ( - A2B2B505259938BD00B45031 /* RxRelay */, - A2B2B507259938BD00B45031 /* RxSwift */, - A2B2B509259938BD00B45031 /* RxCocoa */, ); productName = RxDataSources; productReference = C8984C5A1C36AF35001E4272 /* RxDataSources.framework */; @@ -469,7 +464,6 @@ ); mainGroup = C8984C501C36AF35001E4272; packageReferences = ( - A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */, ); productRefGroup = C8984C5B1C36AF35001E4272 /* Products */; projectDirPath = ""; @@ -1004,35 +998,6 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ - -/* Begin XCRemoteSwiftPackageReference section */ - A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/ReactiveX/RxSwift"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 6.0.0; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - A2B2B505259938BD00B45031 /* RxRelay */ = { - isa = XCSwiftPackageProductDependency; - package = A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */; - productName = RxRelay; - }; - A2B2B507259938BD00B45031 /* RxSwift */ = { - isa = XCSwiftPackageProductDependency; - package = A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */; - productName = RxSwift; - }; - A2B2B509259938BD00B45031 /* RxCocoa */ = { - isa = XCSwiftPackageProductDependency; - package = A2B2B504259938BD00B45031 /* XCRemoteSwiftPackageReference "RxSwift" */; - productName = RxCocoa; - }; -/* End XCSwiftPackageProductDependency section */ }; rootObject = C8984C511C36AF35001E4272 /* Project object */; } diff --git a/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 6451daaf..00000000 --- a/RxDataSources.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "RxSwift", - "repositoryURL": "https://github.com/ReactiveX/RxSwift", - "state": { - "branch": null, - "revision": "c8742ed97fc2f0c015a5ea5eddefb064cd7532d2", - "version": "6.0.0" - } - } - ] - }, - "version": 1 -} From a5ea34922c96c50244d811e7fbacceb72bf3001b Mon Sep 17 00:00:00 2001 From: Elon Park Date: Tue, 11 May 2021 00:22:54 +0900 Subject: [PATCH 54/58] Fix iOS, tvOS Deployment target --- RxDataSources.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index ed3e50a4..b1f92759 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -823,7 +823,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; "LD_RUNPATH_SEARCH_PATHS[sdk=appletvos*]" = "$(inherited)"; "LD_RUNPATH_SEARCH_PATHS[sdk=appletvsimulator*]" = "$(inherited)"; "LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*]" = "$(inherited)"; @@ -836,7 +836,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -889,7 +889,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; "LD_RUNPATH_SEARCH_PATHS[sdk=appletvos*]" = "$(inherited)"; "LD_RUNPATH_SEARCH_PATHS[sdk=appletvsimulator*]" = "$(inherited)"; "LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*]" = "$(inherited)"; @@ -902,7 +902,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; From 90c29b48b628479097fe775ed1966d75ac374518 Mon Sep 17 00:00:00 2001 From: Elon Park Date: Sat, 28 Aug 2021 16:45:00 +0900 Subject: [PATCH 55/58] fix: Travis CI build failed for tvOS --- RxDataSources.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RxDataSources.xcodeproj/project.pbxproj b/RxDataSources.xcodeproj/project.pbxproj index b1f92759..2e84b80b 100644 --- a/RxDataSources.xcodeproj/project.pbxproj +++ b/RxDataSources.xcodeproj/project.pbxproj @@ -17,6 +17,8 @@ 03EEEE981F5B7D71006068BC /* XCTest+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EEEE871F5B7D5C006068BC /* XCTest+Extensions.swift */; }; 70C0622425A8FE3D002A57ED /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F48228489EC009D6516 /* RxSwift.framework */; platformFilter = ios; }; 70C0623425A8FE54002A57ED /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F4A228489EC009D6516 /* RxCocoa.framework */; platformFilter = ios; }; + 70C0622425A8FE3D002A57ED /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F48228489EC009D6516 /* RxSwift.framework */; }; + 70C0623425A8FE54002A57ED /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB1F4A228489EC009D6516 /* RxCocoa.framework */; }; C81FBF461F3B9CED0094061E /* Differentiator.podspec in Resources */ = {isa = PBXBuildFile; fileRef = C81FBF451F3B9CED0094061E /* Differentiator.podspec */; }; C81FBF5E1F3B9D660094061E /* Array+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81FBF5B1F3B9D4C0094061E /* Array+Extensions.swift */; }; C81FBF601F3B9D8B0094061E /* FloatingPointType+IdentifiableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81FBF5F1F3B9D8B0094061E /* FloatingPointType+IdentifiableType.swift */; }; From a65572671e6b61dd1aa1abb208b0f1d7cdff8e27 Mon Sep 17 00:00:00 2001 From: Mike Gopsill <33417092+mgopsill@users.noreply.github.com> Date: Tue, 28 Sep 2021 11:45:40 +0100 Subject: [PATCH 56/58] Update README.md (#395) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6edf9e4..408ec8d7 100644 --- a/README.md +++ b/README.md @@ -159,14 +159,14 @@ For Swift 2.3 version please use versions `0.1 ... 0.9` Podfile ``` -pod 'RxDataSources', '~> 4.0' +pod 'RxDataSources', '~> 5.0' ``` ### Carthage Cartfile ``` -github "RxSwiftCommunity/RxDataSources" ~> 4.0 +github "RxSwiftCommunity/RxDataSources" ~> 5.0 ``` ### Swift Package Manager @@ -179,7 +179,7 @@ import PackageDescription let package = Package( name: "SampleProject", dependencies: [ - .package(url: "https://github.com/RxSwiftCommunity/RxDataSources.git", from: "4.0.0") + .package(url: "https://github.com/RxSwiftCommunity/RxDataSources.git", from: "5.0.0") ] ) ``` From 78253c8a5dfc5ad6fe3ced3b642971d038a2308c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barczi=20B=C3=A1lint?= Date: Thu, 30 Sep 2021 18:16:45 +0200 Subject: [PATCH 57/58] feat: add dynamic spm library support --- Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Package.swift b/Package.swift index eba9c8bb..93ec31a5 100644 --- a/Package.swift +++ b/Package.swift @@ -9,6 +9,7 @@ let package = Package( ], products: [ .library(name: "RxDataSources", targets: ["RxDataSources"]), + .library(name: "RxDataSources-Dynamic", type: .dynamic, targets: ["RxDataSources"]), .library(name: "Differentiator", targets: ["Differentiator"]) ], dependencies: [ From 6b924aaa312eddeaf92e07d22bb3cbdf7e6c3a26 Mon Sep 17 00:00:00 2001 From: Jordan Kay Date: Wed, 9 Feb 2022 23:50:12 -0500 Subject: [PATCH 58/58] Fix typo in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26bc1aa0..dd292d25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -130,7 +130,7 @@ This can break your code if you've implemented those extensions locally. This ca #### Features * Swift 2.3 compatible -* Improves mutability checkes. If data source is being mutated after binding, warning assert is triggered. +* Improves mutability checks. If data source is being mutated after binding, warning assert is triggered. * Deprecates `cellFactory` in favor of `configureCell`. * Improves runtime checks in DEBUG mode for correct `SectionModelType.init` implementation.