From 9ecb3b7c875154a82659ab0e3fa09b9bb03251c2 Mon Sep 17 00:00:00 2001 From: christoff-1992 <1992christoff@gmail.com> Date: Tue, 24 Apr 2018 10:11:54 +0100 Subject: [PATCH 1/2] Update for swift 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As a result of updating the pod 'DataSource' the minimum target is now 9.0, however since we are now on iOS 11.x this shouldnt be an issue. šŸ¤ž --- .swift-version | 2 +- EncryptedDATAStack.podspec | 2 +- .../Classes/EncryptedDATAStack.swift | 6 ++--- .../project.pbxproj | 24 ++++++++++++------- .../AppIcon.appiconset/Contents.json | 17 ++++++++++++- .../EncryptedDATAStack/ViewController.swift | 4 ++-- Example/Podfile | 2 +- Example/Podfile.lock | 14 +++++------ README.md | 4 ++-- 9 files changed, 49 insertions(+), 26 deletions(-) diff --git a/.swift-version b/.swift-version index 9f55b2c..5186d07 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 +4.0 diff --git a/EncryptedDATAStack.podspec b/EncryptedDATAStack.podspec index ea5bf15..1db2ba5 100644 --- a/EncryptedDATAStack.podspec +++ b/EncryptedDATAStack.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'EncryptedDATAStack' - s.version = '7.0.3' + s.version = '8.0.0' s.summary = 'Set up your encrypted database with only 1 line of code!' s.description = <<-DESC diff --git a/EncryptedDATAStack/Classes/EncryptedDATAStack.swift b/EncryptedDATAStack/Classes/EncryptedDATAStack.swift index 156ffc8..0d12a78 100755 --- a/EncryptedDATAStack/Classes/EncryptedDATAStack.swift +++ b/EncryptedDATAStack/Classes/EncryptedDATAStack.swift @@ -361,7 +361,7 @@ import EncryptedCoreData } // Can't be private, has to be internal in order to be used as a selector. - func mainContextDidSave(_ notification: Notification) { + @objc func mainContextDidSave(_ notification: Notification) { self.saveMainThread { error in if let error = error { fatalError("Failed to save objects in main thread: \(error)") @@ -370,14 +370,14 @@ import EncryptedCoreData } // Can't be private, has to be internal in order to be used as a selector. - func newDisposableMainContextWillSave(_ notification: Notification) { + @objc func newDisposableMainContextWillSave(_ notification: Notification) { if let context = notification.object as? NSManagedObjectContext { context.reset() } } // Can't be private, has to be internal in order to be used as a selector. - func backgroundContextDidSave(_ notification: Notification) throws { + @objc func backgroundContextDidSave(_ notification: Notification) throws { if Thread.isMainThread && TestCheck.isTesting == false { throw NSError(info: "Background context saved in the main thread. Use context's `performBlock`", previousError: nil) } else { diff --git a/Example/EncryptedDATAStack.xcodeproj/project.pbxproj b/Example/EncryptedDATAStack.xcodeproj/project.pbxproj index f4055f9..26921d1 100644 --- a/Example/EncryptedDATAStack.xcodeproj/project.pbxproj +++ b/Example/EncryptedDATAStack.xcodeproj/project.pbxproj @@ -229,11 +229,11 @@ 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; DevelopmentTeam = MT49Z4H3J6; - LastSwiftMigration = 0800; + LastSwiftMigration = 0930; }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0930; TestTargetID = 607FACCF1AFB9204008FA782; }; }; @@ -467,7 +467,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -507,7 +507,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -523,11 +523,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = MT49Z4H3J6; INFOPLIST_FILE = EncryptedDATAStack/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.EncryptedDATAStack-Example2"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -539,11 +541,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = MT49Z4H3J6; INFOPLIST_FILE = EncryptedDATAStack/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.EncryptedDATAStack-Example2"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -551,6 +555,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 84ABCD5D8B03D2935C3A658E /* Pods-EncryptedDATAStack_Tests.debug.xcconfig */; buildSettings = { + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -563,7 +568,8 @@ 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; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EncryptedDATAStack_Example.app/EncryptedDATAStack_Example"; }; name = Debug; @@ -572,6 +578,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = B6BFDD279D32D9ABFA1C9E90 /* Pods-EncryptedDATAStack_Tests.release.xcconfig */; buildSettings = { + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -580,7 +587,8 @@ 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; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EncryptedDATAStack_Example.app/EncryptedDATAStack_Example"; }; name = Release; diff --git a/Example/EncryptedDATAStack/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/EncryptedDATAStack/Images.xcassets/AppIcon.appiconset/Contents.json index d3942e9..19882d5 100644 --- a/Example/EncryptedDATAStack/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/EncryptedDATAStack/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", @@ -29,10 +39,15 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file diff --git a/Example/EncryptedDATAStack/ViewController.swift b/Example/EncryptedDATAStack/ViewController.swift index be33080..e56ef09 100755 --- a/Example/EncryptedDATAStack/ViewController.swift +++ b/Example/EncryptedDATAStack/ViewController.swift @@ -42,7 +42,7 @@ class ViewController: UITableViewController { self.navigationItem.leftBarButtonItem = mainButton } - func createBackground() { + @objc func createBackground() { self.dataStack.performInNewBackgroundContext { backgroundContext in let entity = NSEntityDescription.entity(forEntityName: "User", in: backgroundContext)! let object = NSManagedObject(entity: entity, insertInto: backgroundContext) @@ -52,7 +52,7 @@ class ViewController: UITableViewController { } } - func createMain() { + @objc func createMain() { let entity = NSEntityDescription.entity(forEntityName: "User", in: self.dataStack.mainContext)! let object = NSManagedObject(entity: entity, insertInto: self.dataStack.mainContext) object.setValue("Main", forKey: "name") diff --git a/Example/Podfile b/Example/Podfile index 0ff85ed..cc6ebca 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -2,7 +2,7 @@ use_frameworks! target 'EncryptedDATAStack_Example' do pod 'EncryptedDATAStack', :path => '../' - pod 'DATASource’, '~> 6.1.5' + pod 'DATASource’, '~> 7.0.2' pod 'EncryptedCoreData', :git => 'https://github.com/project-imas/encrypted-core-data.git' target 'EncryptedDATAStack_Tests' do diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 4d5234f..1bb5d46 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,8 +1,8 @@ PODS: - - DATASource (6.1.5) + - DATASource (7.0.2) - EncryptedCoreData (3.1): - SQLCipher (~> 3.4.0) - - EncryptedDATAStack (7.0.3): + - EncryptedDATAStack (8.0.0): - EncryptedCoreData (~> 3.1) - SQLCipher (3.4.0): - SQLCipher/standard (= 3.4.0) @@ -11,7 +11,7 @@ PODS: - SQLCipher/common DEPENDENCIES: - - DATASource (~> 6.1.5) + - DATASource (~> 7.0.2) - EncryptedCoreData (from `https://github.com/project-imas/encrypted-core-data.git`) - EncryptedDATAStack (from `../`) @@ -27,11 +27,11 @@ CHECKOUT OPTIONS: :git: https://github.com/project-imas/encrypted-core-data.git SPEC CHECKSUMS: - DATASource: 52b86cfff6c7ac3db45192c01f7839c7473576c3 + DATASource: b86db74542b5b27d4d2af43ae698022f19507379 EncryptedCoreData: f6762fb05f88a52f36c5648659abc91b57f244b4 - EncryptedDATAStack: 84897982fa1826a44a0306af5890cd786c43b4b1 + EncryptedDATAStack: 943692152c4f8fc14599889e3241df2b1adcda42 SQLCipher: 4c768761421736a247ed6cf412d9045615d53dff -PODFILE CHECKSUM: eb0fd5215d30babaff403c4078e4c632c9c0447c +PODFILE CHECKSUM: 55038812cfd8a5894651392d2aa10be95b957f3b -COCOAPODS: 1.3.1 +COCOAPODS: 1.4.0 diff --git a/README.md b/README.md index d14f410..4fc5c10 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # EncryptedDATAStack [![](http://img.shields.io/badge/iOS-8.0%2B-blue.svg)]() -[![](http://img.shields.io/badge/Swift-3-red.svg)]() +[![](http://img.shields.io/badge/Swift-4-red.svg)]() [![CI Status](http://img.shields.io/travis/flipacholas/EncryptedDATAStack.svg?style=flat)](https://travis-ci.org/flipacholas/EncryptedDATAStack) [![Version](https://img.shields.io/cocoapods/v/EncryptedDATAStack.svg?style=flat)](http://cocoapods.org/pods/EncryptedDATAStack) [![License](https://img.shields.io/cocoapods/l/EncryptedDATAStack.svg?style=flat)](http://cocoapods.org/pods/EncryptedDATAStack) @@ -8,7 +8,7 @@ Set up an encrypted Database with only 1 line of code! -**EncryptedDATAStack** is an fork of [DATAStack](https://github.com/SyncDB/DATAStack) with added support of [Encrypted Core Data](https://github.com/project-imas/encrypted-core-data) (Core Data + SQLCipher) and extra legacy support for iOS 8. +**EncryptedDATAStack** is an fork of [DATAStack](https://github.com/SyncDB/DATAStack) with added support of [Encrypted Core Data](https://github.com/project-imas/encrypted-core-data) (Core Data + SQLCipher) and extra legacy support for iOS 9. All in all, this allows you to set up a database (encrypted and/or unencrypted) with only one line of code! Version tags are set to match the version of DATAStack used. From 653b0b441e18de3fdd4ddcf0fb71d8c8f684f79b Mon Sep 17 00:00:00 2001 From: christoff-1992 <1992christoff@gmail.com> Date: Tue, 24 Apr 2018 11:15:56 +0100 Subject: [PATCH 2/2] Update Xcode version --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e1cb2e9..8c56a43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -osx_image: xcode8 +osx_image: xcode9 language: objective-c # cache: cocoapods @@ -12,7 +12,7 @@ before_install: #- set -o pipefail && xcodebuild test -workspace Example/EncryptedDATAStack.xcworkspace -scheme EncryptedDATAStack-Example -destination 'platform=iOS Simulator,name=iPhone 7' ONLY_ACTIVE_ARCH=NO | xcpretty #- pod lib lint -script: +script: - xcodebuild -workspace Example/EncryptedDATAStack.xcworkspace -scheme EncryptedDATAStack-Example -sdk iphonesimulator build test -destination 'platform=iOS Simulator,name=iPhone 7' | xcpretty -c && exit ${PIPESTATUS[0]} - pod lib lint --allow-warnings