Skip to content

Commit

Permalink
Easy access to error code
Browse files Browse the repository at this point in the history
  • Loading branch information
evermeer committed Apr 23, 2018
1 parent 37fa739 commit ec9f2ac
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 30 deletions.
14 changes: 7 additions & 7 deletions AppMessage/AppMessage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
TargetAttributes = {
7F434A2219628D490081F35C = {
CreatedOnToolsVersion = 6.0;
DevelopmentTeam = NFYKDD8CR4;
DevelopmentTeam = X356V8CMHF;
LastSwiftMigration = 0900;
SystemCapabilities = {
com.apple.BackgroundModes = {
Expand Down Expand Up @@ -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";
};
Expand All @@ -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";
};
Expand Down
1 change: 1 addition & 0 deletions AppMessage/AppMessage/Controlers/NewsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
Expand Down
4 changes: 2 additions & 2 deletions AppMessage/AppMessage/Controlers/TestsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 5 additions & 3 deletions EVCloudKitDao.podspec
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -14,10 +14,12 @@ Pod::Spec.new do |s|
s.authors = { 'Edwin Vermeer' => '[email protected]' }
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/*'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 10 additions & 17 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -18,7 +18,7 @@ PODS:
DEPENDENCIES:
- CRToast
- EVCloudKitDao (from `./`)
- EVReflection/CloudKit (from `https://github.com/evermeer/EVReflection.git`)
- EVReflection/CloudKit
- JSQMessagesViewController
- SwiftLocation
- UIImage-Resize
Expand All @@ -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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions Source/EVCloudKitEnums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Copyright © 2015 mirabeau. All rights reserved.
//

import CloudKit

// ------------------------------------------------------------------------
// MARK: - EVCloudKitDao enums
Expand Down Expand Up @@ -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
}
}
}

0 comments on commit ec9f2ac

Please sign in to comment.