Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Swift 4 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodebortoli committed Dec 1, 2017
1 parent cf9af33 commit 5973721
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
12 changes: 2 additions & 10 deletions Example/JustPersist.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
};
Expand All @@ -739,7 +738,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
};
Expand All @@ -763,7 +761,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
};
Expand All @@ -786,7 +783,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
};
Expand Down Expand Up @@ -842,7 +838,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand Down Expand Up @@ -888,7 +884,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -904,7 +900,6 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -919,7 +914,6 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -942,7 +936,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JustPersist_Example.app/JustPersist_Example";
};
name = Debug;
Expand All @@ -961,7 +954,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JustPersist_Example.app/JustPersist_Example";
};
name = Release;
Expand Down
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- JustPersist/Core (1.0.2)
- JustPersist/MagicalRecord (1.0.2):
- JustPersist/Core (1.1.0)
- JustPersist/MagicalRecord (1.1.0):
- JustPersist/Core
- MagicalRecord (~> 2.3.2)
- JustPersist/Skopelos (1.0.2):
- JustPersist/Skopelos (1.1.0):
- JustPersist/Core
- Skopelos (~> 2.1.0)
- MagicalRecord (2.3.2):
Expand All @@ -20,7 +20,7 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
JustPersist: 5f460f093f7fd0b4a6be26de248e018787f1fd8c
JustPersist: 3990e2114fef7c4487db8b7c8fc92531b807eb08
MagicalRecord: 53bed74b4323b930992a725be713e53b37d19755
Skopelos: 27608e9ed6e880d6a33c1cbd569cf3ed1c6c8f06

Expand Down
2 changes: 1 addition & 1 deletion JustPersist.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'JustPersist'
s.version = '1.1.0'
s.version = '2.0.0'
s.summary = 'JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box. It also allows you to migrate to any other persistence framework with minimal effort.'

s.description = "<<-DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import CoreData

@objc(JEChildCoreDataStore)
@objcMembers
class ChildCoreDataStore: NSObject {

enum ErrorCode: Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import CoreData

@objc (JECoreDataAccessor)
@objcMembers
class CoreDataAccessor: NSObject {

let errorDomain = "com.just-eat.CoreDataAccessor.Error"
Expand Down
4 changes: 2 additions & 2 deletions JustPersist/Classes/Core/Interface/DataStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

public typealias DataStoreErrorHandler = (NSError) -> Void

@objc(JEDataStore)
@objc
public protocol DataStore: class {

var errorHandler: DataStoreErrorHandler? { get set }
Expand Down Expand Up @@ -67,7 +67,7 @@ public protocol DataStore: class {
func merge(_ childDataStore: ChildDataStore)
}

@objc(JEChildDataStore)
@objc
public protocol ChildDataStore: DataStore {

var parent: DataStore { get }
Expand Down
6 changes: 3 additions & 3 deletions JustPersist/Classes/Core/Interface/DataStoreAccessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

import Foundation

@objc(JEDataStoreAccessor)
@objc
public protocol DataStoreAccessor: class {

}

@objc(JEDataStoreReadAccessor)
@objc
public protocol DataStoreReadAccessor: DataStoreAccessor {

/**
Expand Down Expand Up @@ -45,7 +45,7 @@ public protocol DataStoreReadAccessor: DataStoreAccessor {

}

@objc(JEDataStoreReadWriteAccessor)
@objc
public protocol DataStoreReadWriteAccessor: DataStoreReadAccessor {

/**
Expand Down
6 changes: 3 additions & 3 deletions JustPersist/Classes/Core/Interface/DataStoreItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// Copyright © 2016 JUST EAT. All rights reserved.
//

@objc(JEDataStoreItem)
public protocol DataStoreItem {
@objc
public protocol DataStoreItem: class {

/// Key used by the dataStore to identify items of this type
static var itemTypeKey: String { get }
Expand All @@ -25,7 +25,7 @@ public protocol DataStoreItem {
func value(forKeyPath keyPath: String) -> Any?
}

@objc(JEMutableDataStoreItem)
@objc
public protocol MutableDataStoreItem: DataStoreItem {

/**
Expand Down
2 changes: 1 addition & 1 deletion JustPersist/Classes/Core/Interface/DataStoreRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

@objc(JEDataStoreRequest)
@objcMembers
open class DataStoreRequest: NSObject {

open let itemType: DataStoreItem.Type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
extension DataStoreUsing where Self: UIViewController {

func passDataStore(alongSegue segue: UIStoryboardSegue) {
guard let dataStoreRecipiant = segue.destination as? DataStoreUsing else { return }
guard var dataStoreRecipiant = segue.destination as? DataStoreUsing else { return }
dataStoreRecipiant.dataStore = dataStore
}
}
2 changes: 1 addition & 1 deletion JustPersist/Classes/Core/Interface/DataStoreUsing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

@objc(JEDataStoreUsing)
@objc
protocol DataStoreUsing {

var dataStore: DataStore { get set }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import UIKit
import CoreData
import MagicalRecord

@objc(JEMagicalRecordDataStore)
@objcMembers
open class MagicalRecordDataStore: NSObject {

enum ErrorCode: Int {
Expand Down
3 changes: 2 additions & 1 deletion JustPersist/Classes/Wrappers/Skopelos/SkopelosClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import Foundation
import CoreData
import Skopelos

@objc
protocol SkopelosClientDelegate: class {
func handle(_ error: NSError) -> Void
}

@objc(JESkopelosClient)
@objcMembers
class SkopelosClient: Skopelos {

weak var delegate: SkopelosClientDelegate?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import CoreData
import Skopelos

@objc(JESkopelosDataStore)
@objcMembers
open class SkopelosDataStore: NSObject {

enum ErrorCode: Int {
Expand Down

0 comments on commit 5973721

Please sign in to comment.