From 7b87055c572254eba4b383e976239d9c00c862b6 Mon Sep 17 00:00:00 2001 From: Denys Telezhkin Date: Fri, 28 Oct 2016 17:28:40 +0300 Subject: [PATCH] Xcode 8.1 / Swift 3.0.1 update. Bump to 4.0.0 --- CHANGELOG.md | 2 +- Carthage/Checkouts/realm-cocoa | 2 +- DTModelStorage.podspec | 2 +- DTModelStorage.xcodeproj/project.pbxproj | 6 +++++- .../xcshareddata/xcschemes/DTModelStorage-iOS.xcscheme | 2 +- .../xcshareddata/xcschemes/DTModelStorage-tvOS.xcscheme | 2 +- README.md | 6 +++--- Source/Core/EventReactions.swift | 8 ++++---- Tests/Specs/MappingTestCase.swift | 4 ++-- Tests/Specs/RuntimeHelperTestCase.swift | 2 +- Tests/Specs/UIReactionsTestCase.swift | 2 +- 11 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9971f5c..7ad6dad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log All notable changes to this project will be documented in this file. -## Next +## [4.0.0](https://github.com/DenHeadless/DTModelStorage/releases/tag/4.0.0) * `StorageUpdate` properties, that tracked changes independently of each other, have been replaced with `objectChanges`, `sectionChanges` arrays, that track all changes in order they occured * `StorageUpdate` now has `updatedObjects` dictionary, that allow tracking objects, that have been updated, along with corresponding indexPath. It is done because UITableView and UICollectionView defer cell updates after insertions and deletions are completed, and therefore shift indexPaths. For example, if you were to insert 0 item and update it, UITableView would think that you are updating 1 item instead of 0, because it happens in single animation block and 0 item becomes 1. diff --git a/Carthage/Checkouts/realm-cocoa b/Carthage/Checkouts/realm-cocoa index dcc66532..bfcd87e6 160000 --- a/Carthage/Checkouts/realm-cocoa +++ b/Carthage/Checkouts/realm-cocoa @@ -1 +1 @@ -Subproject commit dcc6653205e796d4bfc79082d3c9b1849d263ab5 +Subproject commit bfcd87e6757570f1eed23fc5c1842116978810d3 diff --git a/DTModelStorage.podspec b/DTModelStorage.podspec index 2680217f..d32a2361 100644 --- a/DTModelStorage.podspec +++ b/DTModelStorage.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'DTModelStorage' - s.version = '3.0.0' + s.version = '4.0.0' s.license = 'MIT' s.summary = 'Storage classes for datasource based controls.' s.homepage = 'https://github.com/DenHeadless/DTModelStorage' diff --git a/DTModelStorage.xcodeproj/project.pbxproj b/DTModelStorage.xcodeproj/project.pbxproj index 26a4548e..e855d65f 100644 --- a/DTModelStorage.xcodeproj/project.pbxproj +++ b/DTModelStorage.xcodeproj/project.pbxproj @@ -612,7 +612,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0810; ORGANIZATIONNAME = "Denys Telezhkin"; TargetAttributes = { 9A2A385A1AEE24340021E97D = { @@ -916,6 +916,7 @@ 9A2A386E1AEE24350021E97D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -939,6 +940,7 @@ 9A2A386F1AEE24350021E97D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -958,6 +960,7 @@ 9A4C3BC11BE4E32B000931BA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -983,6 +986,7 @@ 9A4C3BC21BE4E32B000931BA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; diff --git a/DTModelStorage.xcodeproj/xcshareddata/xcschemes/DTModelStorage-iOS.xcscheme b/DTModelStorage.xcodeproj/xcshareddata/xcschemes/DTModelStorage-iOS.xcscheme index 6b68375e..99d6f6fa 100644 --- a/DTModelStorage.xcodeproj/xcshareddata/xcschemes/DTModelStorage-iOS.xcscheme +++ b/DTModelStorage.xcodeproj/xcshareddata/xcschemes/DTModelStorage-iOS.xcscheme @@ -1,6 +1,6 @@ This is a child-project for [DTTableViewManager](https://github.com/DenHeadless/DTTableViewManager) and [DTCollectionViewManager](https://github.com/DenHeadless/DTCollectionViewManager) - great tools for UITableView and UICollectionView management. @@ -145,11 +145,11 @@ Installation [CocoaPods](https://cocoapods.org): - pod 'DTModelStorage', '~> 3.0.0' + pod 'DTModelStorage', '~> 4.0.0' [Carthage](https://github.com/Carthage/Carthage) - github "DenHeadless/DTModelStorage" ~> 3.0.0 + github "DenHeadless/DTModelStorage" ~> 4.0.0 Requirements ============ diff --git a/Source/Core/EventReactions.swift b/Source/Core/EventReactions.swift index ed76ae30..7444d587 100644 --- a/Source/Core/EventReactions.swift +++ b/Source/Core/EventReactions.swift @@ -136,7 +136,7 @@ open class EventReaction { /// Performs reaction with `arguments`. open func performWithArguments(_ arguments: (Any,Any,Any)) -> Any { - return reaction?(arguments.0,arguments.1,arguments.2) + return reaction?(arguments.0,arguments.1,arguments.2) ?? 0 } } @@ -148,7 +148,7 @@ open class FourArgumentsEventReaction : EventReaction { /// Performs reaction with `arguments`. open func performWithArguments(_ arguments: (Any, Any, Any, Any)) -> Any { - return reaction4Arguments?(arguments.0, arguments.1, arguments.2, arguments.3) + return reaction4Arguments?(arguments.0, arguments.1, arguments.2, arguments.3) ?? 0 } } @@ -160,7 +160,7 @@ open class FiveArgumentsEventReaction : EventReaction { /// Performs reaction with `arguments`. open func performWithArguments(_ arguments: (Any, Any, Any, Any, Any)) -> Any { - return reaction5Arguments?(arguments.0, arguments.1, arguments.2, arguments.3, arguments.4) + return reaction5Arguments?(arguments.0, arguments.1, arguments.2, arguments.3, arguments.4) ?? 0 } } @@ -180,7 +180,7 @@ public extension RangeReplaceableCollection where Self.Iterator.Element: EventRe guard let reaction = reaction(of: type, signature: signature, forModel: model) else { return 0 } - return reaction.performWithArguments((view,model,location)) + return reaction.performWithArguments((view ?? 0,model,location)) } } diff --git a/Tests/Specs/MappingTestCase.swift b/Tests/Specs/MappingTestCase.swift index 4bca6818..5d990df9 100644 --- a/Tests/Specs/MappingTestCase.swift +++ b/Tests/Specs/MappingTestCase.swift @@ -55,7 +55,7 @@ class MappingTestCase: XCTestCase { func testOptionalModelOfProtocolIsFindable() { mappings.addMapping(for: .cell, viewClass: ProtocolTestableTableViewCell.self) let optional: ConformingClass? = ConformingClass() - let candidates = mappings.mappingCandidates(for: .cell, withModel: optional) + let candidates = mappings.mappingCandidates(for: .cell, withModel: optional ?? 0) expect(candidates.count) == 1 expect(candidates.first?.viewClass == ProtocolTestableTableViewCell.self).to(beTrue()) } @@ -71,7 +71,7 @@ class MappingTestCase: XCTestCase { func testNilModelDoesNotReturnMappingCandidates() { mappings.addMapping(for: .cell, viewClass: SubclassTestableTableViewCell.self) let model : AncestorClass? = nil - let candidates = mappings.mappingCandidates(for: .cell, withModel: model) + let candidates = mappings.mappingCandidates(for: .cell, withModel: model as Any) expect(candidates.count) == 0 } diff --git a/Tests/Specs/RuntimeHelperTestCase.swift b/Tests/Specs/RuntimeHelperTestCase.swift index c5fa28f7..9463d6d3 100644 --- a/Tests/Specs/RuntimeHelperTestCase.swift +++ b/Tests/Specs/RuntimeHelperTestCase.swift @@ -16,7 +16,7 @@ class RuntimeHelperTestCase: XCTestCase { func testRuntimeHelperIsAbleToRecursivelyUnwrapButReturnNil() { let implicitlyUnwrapped : Int? = nil - let unwrapped = RuntimeHelper.recursivelyUnwrapAnyValue(implicitlyUnwrapped) + let unwrapped = RuntimeHelper.recursivelyUnwrapAnyValue(implicitlyUnwrapped as Any) expect(unwrapped).to(beNil()) } } diff --git a/Tests/Specs/UIReactionsTestCase.swift b/Tests/Specs/UIReactionsTestCase.swift index 0268cb26..b418bb8b 100644 --- a/Tests/Specs/UIReactionsTestCase.swift +++ b/Tests/Specs/UIReactionsTestCase.swift @@ -45,7 +45,7 @@ class UIReactionsTestCase: XCTestCase { let nilModel: Int? = 5 - let foundReaction = reactions.reaction(of: .cell, signature: "foo", forModel: nilModel) + let foundReaction = reactions.reaction(of: .cell, signature: "foo", forModel: nilModel as Any) expect(foundReaction).toNot(beNil()) }