Skip to content

Commit

Permalink
v0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
colbylwilliams committed Jan 3, 2018
1 parent 2760656 commit b03b0ae
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 74 deletions.
4 changes: 4 additions & 0 deletions AzureData Sample/AzureData Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
930B2F4D1FFD61FD00F86BF1 /* CustomDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 930B2F4C1FFD61FD00F86BF1 /* CustomDocument.swift */; };
B53401511FB386890063BCC7 /* AzureData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B53401501FB386890063BCC7 /* AzureData.framework */; };
B55AEF861FB3480300F7BEED /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B55AEF851FB3480300F7BEED /* AppDelegate.swift */; };
B55AEF8B1FB3480400F7BEED /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B55AEF891FB3480400F7BEED /* Main.storyboard */; };
Expand Down Expand Up @@ -36,6 +37,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
930B2F4C1FFD61FD00F86BF1 /* CustomDocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomDocument.swift; sourceTree = "<group>"; };
B53401501FB386890063BCC7 /* AzureData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AzureData.framework; path = Carthage/Build/iOS/AzureData.framework; sourceTree = "<group>"; };
B55AEF831FB3480300F7BEED /* AzureData iOS Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AzureData iOS Sample.app"; sourceTree = BUILT_PRODUCTS_DIR; };
B55AEF851FB3480300F7BEED /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -114,6 +116,7 @@
B55AEF8E1FB3480400F7BEED /* LaunchScreen.storyboard */,
B55AEF891FB3480400F7BEED /* Main.storyboard */,
B5860EDB1FBD41AF003CB80A /* Extensions.swift */,
930B2F4C1FFD61FD00F86BF1 /* CustomDocument.swift */,
);
path = "AzureData iOS Sample";
sourceTree = "<group>";
Expand Down Expand Up @@ -292,6 +295,7 @@
buildActionMask = 2147483647;
files = (
B55AEFD01FB3495100F7BEED /* DocumentTableViewController.swift in Sources */,
930B2F4D1FFD61FD00F86BF1 /* CustomDocument.swift in Sources */,
B55AEFD41FB3495100F7BEED /* CollectionTableViewController.swift in Sources */,
B55AEFCE1FB3495100F7BEED /* StoredProcedureTableViewController.swift in Sources */,
B55AEFCD1FB3495100F7BEED /* UserDefinedFunctionTableViewController.swift in Sources */,
Expand Down
21 changes: 21 additions & 0 deletions AzureData Sample/AzureData iOS Sample/CustomDocument.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// CustomDocument.swift
// AzureData iOS Sample
//
// Created by Colby L Williams on 1/3/18.
// Copyright © 2018 Colby Williams. All rights reserved.
//

import Foundation
import AzureData

class CustomDocument: Document {

var testNumber: Double?
var testDate: Date?
var testString: String?

override var debugDescription: String {
return "\(super.debugDescription)\n\ttestNumber : \(testNumber ?? 0)\n\ttestDate : \(testDate?.debugDescription ?? "nil")\n\ttestString : \(testString ?? "nil")\n--"
}
}
2 changes: 1 addition & 1 deletion AzureData Sample/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "colbylwilliams/Azure.iOS" "v0.5.5"
github "colbylwilliams/Azure.iOS" "v0.5.6"
2 changes: 1 addition & 1 deletion AzureData/Source/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.5.5</string>
<string>0.5.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
45 changes: 1 addition & 44 deletions AzureData/Source/Resources/DictionaryDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,7 @@ public class DictionaryDocument : Document {

let sysKeys = ["id", "_rid", "_self", "_etag", "_ts", "_attachments"]

//public static var type = "docs"
//public static var list = "Documents"

// public private(set) var id: String
// public private(set) var resourceId: String
// public private(set) var selfLink: String?
// public private(set) var etag: String?
// public private(set) var timestamp: Date?


/// Gets the self-link corresponding to attachments of the document from the Azure Cosmos DB service.
// public private(set) var attachmentsLink: String?

/// Gets or sets the time to live in seconds of the document in the Azure Cosmos DB service.
// public var timeToLive: Int? = nil



public private(set) var data: CodableDictionary?


Expand All @@ -54,28 +38,10 @@ public class DictionaryDocument : Document {
}
}

// private enum SysCodingKeys: String, CodingKey {
// case id
// case resourceId = "_rid"
// case selfLink = "_self"
// case etag = "_etag"
// case timestamp = "_ts"
// case attachmentsLink = "_attachments"
// }

public required init(from decoder: Decoder) throws {

try super.init(from: decoder)

// let sysContainer = try decoder.container(keyedBy: SysCodingKeys.self)
//
// id = try sysContainer.decode(String.self, forKey: .id)
// resourceId = try sysContainer.decode(String.self, forKey: .resourceId)
// selfLink = try sysContainer.decode(String.self, forKey: .selfLink)
// etag = try sysContainer.decode(String.self, forKey: .etag)
// timestamp = try sysContainer.decode(Date.self, forKey: .timestamp)
// attachmentsLink = try sysContainer.decode(String.self, forKey: .attachmentsLink)

if Swift.type(of: self) == DictionaryDocument.self {

let userContainer = try decoder.container(keyedBy: UserCodingKeys.self)
Expand All @@ -95,15 +61,6 @@ public class DictionaryDocument : Document {

try super.encode(to: encoder)

// var sysContainer = encoder.container(keyedBy: SysCodingKeys.self)
//
// try sysContainer.encode(id, forKey: .id)
// try sysContainer.encode(resourceId, forKey: .resourceId)
// try sysContainer.encode(selfLink, forKey: .selfLink)
// try sysContainer.encode(etag, forKey: .etag)
// try sysContainer.encode(timestamp, forKey: .timestamp)
// try sysContainer.encode(attachmentsLink, forKey: .attachmentsLink)

if Swift.type(of: self) == DictionaryDocument.self {

var userContainer = encoder.container(keyedBy: UserCodingKeys.self)
Expand Down
29 changes: 1 addition & 28 deletions AzureData/Source/Resources/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import Foundation
/// and a document may contain any number of custom properties as well as an optional list of attachments.
/// Document is an application resource and can be authorized using the master key or resource keys.
open class Document : CodableResource, CustomDebugStringConvertible {

// let sysKeys = ["id", "_rid", "_self", "_etag", "_ts", "_attachments"]

public static var type = "docs"
public static var list = "Documents"
Expand All @@ -39,32 +37,7 @@ open class Document : CodableResource, CustomDebugStringConvertible {
public init (_ id: String) { self.id = id; resourceId = "" }


// public required init(from decoder: Decoder) throws {
//
// let container = try decoder.container(keyedBy: CodingKeys.self)
//
// id = try container.decode(String.self, forKey: .id)
// resourceId = try container.decode(String.self, forKey: .resourceId)
// selfLink = try container.decode(String.self, forKey: .selfLink)
// etag = try container.decode(String.self, forKey: .etag)
// timestamp = try container.decode(Date.self, forKey: .timestamp)
// attachmentsLink = try container.decode(String.self, forKey: .attachmentsLink)
// }
//
//
// open func encode(to encoder: Encoder) throws {
//
// var container = encoder.container(keyedBy: CodingKeys.self)
//
// try container.encode(id, forKey: .id)
// try container.encode(resourceId, forKey: .resourceId)
// try container.encode(selfLink, forKey: .selfLink)
// try container.encode(etag, forKey: .etag)
// try container.encode(timestamp, forKey: .timestamp)
// try container.encode(attachmentsLink, forKey: .attachmentsLink)
// }

public var debugDescription: String {
open var debugDescription: String {
return "Document :\n\tid : \(self.id)\n\tresourceId : \(self.resourceId)\n\tselfLink : \(self.selfLink.valueOrNilString)\n\tetag : \(self.etag.valueOrNilString)\n\ttimestamp : \(self.timestamp.valueOrNilString)\n\tattachmentsLink : \(self.attachmentsLink.valueOrNilString)\n--"
}
}
Expand Down

0 comments on commit b03b0ae

Please sign in to comment.