Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Update] code to Swift 5 version #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions DBClient.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'DBClient'
s.version = '1.3'
s.version = '1.4'
s.requires_arc = true
s.summary = 'CoreData & Realm wrapper written on Swift'
s.homepage = ''
Expand All @@ -11,9 +11,9 @@ Pod::Spec.new do |s|
s.homepage = 'https://yalantis.com/'

s.ios.deployment_target = '10.0'
s.swift_version = '4.2'
s.swift_version = '5'

s.dependency 'YALResult', '1.1'
s.dependency 'YALResult', '1.4'

s.default_subspec = 'Core'

Expand All @@ -30,6 +30,6 @@ Pod::Spec.new do |s|
s.subspec 'Realm' do |spec|
spec.dependency 'DBClient/Core'
spec.source_files = ['DBClient/Realm/*.swift']
spec.dependency 'RealmSwift', '~> 3.11.1'
spec.dependency 'RealmSwift', '~> 3.15.0'
end
end
2 changes: 1 addition & 1 deletion DBClient/Core/DBClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import YALResult

public typealias Result = YALResult.Result
public typealias Result = YALResult

public enum DBClientError: Error {

Expand Down
4 changes: 4 additions & 0 deletions DBClient/CoreData/CoreDataObservable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ private class FetchedResultsControllerDelegate<T: NSManagedObject>: NSObject, NS

case .update, .move:
batchChanges.append(.update(indexPath!.row, object))

@unknown
default:
assertionFailure("trying to handle unknown case \(type)")
}
}

Expand Down
9 changes: 5 additions & 4 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -551,7 +552,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.yalantis.DBClientTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
};
name = Debug;
Expand All @@ -565,7 +566,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.yalantis.DBClientTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
};
name = Release;
Expand Down Expand Up @@ -688,7 +689,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.yalantis.dbclient.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -701,7 +702,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.yalantis.dbclient.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
34 changes: 17 additions & 17 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
PODS:
- DBClient/Core (1.2):
- YALResult (= 1.1)
- DBClient/CoreData (1.2):
- DBClient/Core (1.4):
- YALResult (= 1.4)
- DBClient/CoreData (1.4):
- DBClient/Core
- YALResult (= 1.1)
- DBClient/Realm (1.2):
- YALResult (= 1.4)
- DBClient/Realm (1.4):
- DBClient/Core
- RealmSwift (~> 3.11.1)
- YALResult (= 1.1)
- Realm (3.11.1):
- Realm/Headers (= 3.11.1)
- Realm/Headers (3.11.1)
- RealmSwift (3.11.1):
- Realm (= 3.11.1)
- YALResult (1.1)
- RealmSwift (~> 3.15.0)
- YALResult (= 1.4)
- Realm (3.15.0):
- Realm/Headers (= 3.15.0)
- Realm/Headers (3.15.0)
- RealmSwift (3.15.0):
- Realm (= 3.15.0)
- YALResult (1.4)

DEPENDENCIES:
- DBClient/CoreData (from `../`)
Expand All @@ -30,10 +30,10 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
DBClient: 28d90aa11a7ba462416ccc2e91bfb19282cf5941
Realm: 037c5919b9ceb59d6beed5d3b031096856b119b3
RealmSwift: c9580133e73ef40ed340401af2dbc9a5790dfea7
YALResult: e7acf1405252ef9a2a1f121176cc44b588844d93
DBClient: e97c5dd333ac354778f17740ea7bcd6e27645ce9
Realm: 9b834e1be6062f544805252c812348872dc5d4ed
RealmSwift: 8a41886f8ab6efef9eb8df97de2f2bb911561a79
YALResult: 26915691cdd19269936336d6f28e1a015c64175e

PODFILE CHECKSUM: 01e2cf56f70348c45b9e7248a505591dd86d210b

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public func upsertManagedObject(in context: NSManagedObjectContext, existedInsta

| Version | Swift | Dependencies | iOS |
|----------|-------|----------------------------------------|------|
| `1.4` | 5 | RealmSwift 3.15.0, YALResult 1.4 | 10 |
| `1.3` | 4.2 | RealmSwift 3.11.1, YALResult 1.1 | 10 |
| `1.0` | 4.2 | RealmSwift 2.10.1, YALResult 1.0 | 10 |
| `0.7` | 4.0 | RealmSwift 2.10.1, BoltsSwift 1.4 | 9 |
Expand Down