Skip to content

Commit

Permalink
Xcode 8.1 / Swift 3.0.1 update. Bump to 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DenTelezhkin committed Oct 28, 2016
1 parent def3dac commit 7b87055
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Carthage/Checkouts/realm-cocoa
2 changes: 1 addition & 1 deletion DTModelStorage.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
6 changes: 5 additions & 1 deletion DTModelStorage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0810;
ORGANIZATIONNAME = "Denys Telezhkin";
TargetAttributes = {
9A2A385A1AEE24340021E97D = {
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![CocoaPod version](https://cocoapod-badges.herokuapp.com/v/DTModelStorage/badge.png) &nbsp;
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)]()
DTModelStorage 3
DTModelStorage
================

> 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.
Expand Down Expand Up @@ -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
============
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/EventReactions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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))
}
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/Specs/MappingTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Specs/RuntimeHelperTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
2 changes: 1 addition & 1 deletion Tests/Specs/UIReactionsTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down

0 comments on commit 7b87055

Please sign in to comment.