diff --git a/AppMessage/AppMessage.xcodeproj/project.pbxproj b/AppMessage/AppMessage.xcodeproj/project.pbxproj index 9e09e33..e0390d5 100755 --- a/AppMessage/AppMessage.xcodeproj/project.pbxproj +++ b/AppMessage/AppMessage.xcodeproj/project.pbxproj @@ -291,7 +291,7 @@ TargetAttributes = { 7F434A2219628D490081F35C = { CreatedOnToolsVersion = 6.0; - DevelopmentTeam = NFYKDD8CR4; + DevelopmentTeam = X356V8CMHF; LastSwiftMigration = 0900; SystemCapabilities = { com.apple.BackgroundModes = { @@ -562,16 +562,16 @@ CODE_SIGN_ENTITLEMENTS = AppMessage/AppMessage.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = NFYKDD8CR4; + DEVELOPMENT_TEAM = X356V8CMHF; INFOPLIST_FILE = AppMessage/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = nl.clockwork.AppMessage; + PRODUCT_BUNDLE_IDENTIFIER = nl.saz.AppMessage; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "AppMessage/AppMessage-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -587,15 +587,15 @@ CODE_SIGN_ENTITLEMENTS = AppMessage/AppMessage.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = NFYKDD8CR4; + DEVELOPMENT_TEAM = X356V8CMHF; INFOPLIST_FILE = AppMessage/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = nl.clockwork.AppMessage; + PRODUCT_BUNDLE_IDENTIFIER = nl.saz.AppMessage; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "AppMessage/AppMessage-Bridging-Header.h"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/AppMessage/AppMessage/Controlers/NewsViewController.swift b/AppMessage/AppMessage/Controlers/NewsViewController.swift index ed7a00f..bc48d38 100755 --- a/AppMessage/AppMessage/Controlers/NewsViewController.swift +++ b/AppMessage/AppMessage/Controlers/NewsViewController.swift @@ -69,6 +69,7 @@ class NewsViewController: UIViewController, UITableViewDataSource, UITableViewDe //This line all you need to get the correct data for the cell if let news: News = EVCloudData.publicDB.data["News_All"]![(indexPath as NSIndexPath).row] as? News { + print("\(news)") cell.textLabel?.text = "\(news.Subject)" cell.detailTextLabel?.text = "(\(news.creationDate)) - \(news.Body)" } diff --git a/AppMessage/AppMessage/Controlers/TestsViewController.swift b/AppMessage/AppMessage/Controlers/TestsViewController.swift index 377cca3..1e9641d 100755 --- a/AppMessage/AppMessage/Controlers/TestsViewController.swift +++ b/AppMessage/AppMessage/Controlers/TestsViewController.swift @@ -153,8 +153,8 @@ class TestsViewController: UIViewController { func saveAndDeleteTest() { let userIdTo: String = userId let message = Message() - message.From = dao.referenceForId(userId) - message.To = dao.referenceForId(userIdTo) + message.setFromFields(userId) + message.setToFields(userIdTo) message.Text = "This is the message text" message.MessageType = MessageTypeEnum.Text.rawValue diff --git a/EVCloudKitDao.podspec b/EVCloudKitDao.podspec index 6eb0150..0b23755 100755 --- a/EVCloudKitDao.podspec +++ b/EVCloudKitDao.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "EVCloudKitDao" - s.version = "3.5.0" + s.version = "3.5.1" s.summary = "iOS: Simplified access to Apple’s CloudKit" s.description = "Simplified access to Apple’s CloudKit using reflection and generics" @@ -14,10 +14,12 @@ Pod::Spec.new do |s| s.authors = { 'Edwin Vermeer' => 'edwin@evict.nl' } s.social_media_url = "http://twitter.com/evermeer" - s.ios.deployment_target = '9.0' + s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.11' + #s.watchos.deployment_target = '3.0' s.tvos.deployment_target = '9.0' - #s.watchos.deployment_target = '2.0' + + s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' } s.source = { :git => "https://github.com/evermeer/EVCloudKitDao.git", :tag => s.version.to_s } s.source_files = 'Source/*' diff --git a/EVCloudKitDao.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/EVCloudKitDao.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/EVCloudKitDao.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Podfile b/Podfile index 8072247..8d94b77 100755 --- a/Podfile +++ b/Podfile @@ -11,7 +11,7 @@ def libraries pod 'UzysAssetsPickerController' pod 'VIPhotoView' #pod 'SSASideMenu' --> for now included - pod 'EVReflection/CloudKit', :git => 'https://github.com/evermeer/EVReflection.git' + pod 'EVReflection/CloudKit' end target 'AppMessage' do diff --git a/Podfile.lock b/Podfile.lock index 708653b..851527b 100755 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,14 +1,14 @@ PODS: - CRToast (0.0.9) - - EVCloudKitDao (3.5.0): + - EVCloudKitDao (3.5.1): - EVReflection/CloudKit - - EVReflection/CloudKit (5.4.0): + - EVReflection/CloudKit (5.6.1): - EVReflection/Core - - EVReflection/Core (5.4.0) + - EVReflection/Core (5.6.1) - JSQMessagesViewController (7.3.5): - JSQSystemSoundPlayer (~> 2.0.1) - JSQSystemSoundPlayer (2.0.1) - - SwiftLocation (3.1.0): + - SwiftLocation (3.2.3): - SwiftyJSON (~> 4.0.0-alpha.1) - SwiftyJSON (4.0.0) - UIImage-Resize (1.0.1) @@ -18,7 +18,7 @@ PODS: DEPENDENCIES: - CRToast - EVCloudKitDao (from `./`) - - EVReflection/CloudKit (from `https://github.com/evermeer/EVReflection.git`) + - EVReflection/CloudKit - JSQMessagesViewController - SwiftLocation - UIImage-Resize @@ -28,26 +28,19 @@ DEPENDENCIES: EXTERNAL SOURCES: EVCloudKitDao: :path: ./ - EVReflection: - :git: https://github.com/evermeer/EVReflection.git - -CHECKOUT OPTIONS: - EVReflection: - :commit: 09e6acdf49e8be89f402d3e6feee3413ce5c53dd - :git: https://github.com/evermeer/EVReflection.git SPEC CHECKSUMS: CRToast: 5a78c22b921c5ed3487488af605bc403a9c92fed - EVCloudKitDao: b79984e657dc7add73be3f1e90eb4e33509ea3b3 - EVReflection: fcea2958ae3bf621293afb800b708c1c9daaf89e + EVCloudKitDao: 153da4f81e8615b3e004cfe408e1bd28dd953802 + EVReflection: d05ebbafc851b7a4cd3d625182662463a5819ab8 JSQMessagesViewController: 6587f56aedbcb150a8ba1d968e1ef58b1bc758b7 JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d - SwiftLocation: 8f5ef4f510a45e43239de57a3145b3669301e898 + SwiftLocation: a3c3bc2023118171ef3572188a31def94aa0892c SwiftyJSON: 070dabdcb1beb81b247c65ffa3a79dbbfb3b48aa UIImage-Resize: fa776860f10e6900bbaf53a73e494bdceaaccc77 UzysAssetsPickerController: 47c27bd96955467925f3d4d80b1e2e8aaeff766d VIPhotoView: bdc0cf8ddadda754b451869bd3a919e8eb5c11ab -PODFILE CHECKSUM: 5d40e568a3c21f9601112d4ce2cc9f5ceebd9d7d +PODFILE CHECKSUM: 802654b43f9d50db77cbd50f60af97e5020f6f5a -COCOAPODS: 1.3.1 +COCOAPODS: 1.4.0 diff --git a/README.md b/README.md index 039ce9f..f64c694 100755 --- a/README.md +++ b/README.md @@ -375,6 +375,9 @@ func initializeCommunication(retryCount: Double = 1) { self.initializeCommunication(retryCount: retryCount + 1) } case .Fail: + if error.code == .limitExceeded { + //TODO: try again with a smaller load? + } Helper.showError("Could not load messages: \(error.localizedDescription)") default: // For here there is no need to handle the .Success, and .RecoverableError break diff --git a/Source/EVCloudKitEnums.swift b/Source/EVCloudKitEnums.swift index da09e7f..0976d84 100755 --- a/Source/EVCloudKitEnums.swift +++ b/Source/EVCloudKitEnums.swift @@ -5,6 +5,7 @@ // Copyright © 2015 mirabeau. All rights reserved. // +import CloudKit // ------------------------------------------------------------------------ // MARK: - EVCloudKitDao enums @@ -155,4 +156,14 @@ func !=(leftPart: CachingStrategy, rightPart: CachingStrategy) -> Bool { return !(leftPart == rightPart) } +/** + Helper function for easy acces to the cloudkit error code + */ +public extension Error { + public var code: CKError.Code { + get { + return CKError(_nsError: self as NSError).code + } + } +}