Skip to content
This repository was archived by the owner on Jan 25, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "antitypical/Result" "2.0.0"
github "SwiftyJSON/SwiftyJSON" "2.3.3"
github "Thomvis/BrightFutures" "v4.0.1"
github "antitypical/Result" "2.1.3"
github "SwiftyJSON/SwiftyJSON" "2.4.0"
github "Thomvis/BrightFutures" "v4.1.1"
6 changes: 6 additions & 0 deletions Spine.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,11 @@
};
D373F78719B2249900275AFC = {
CreatedOnToolsVersion = 6.0;
LastSwiftMigration = 0800;
};
D373F79219B2249900275AFC = {
CreatedOnToolsVersion = 6.0;
LastSwiftMigration = 0800;
};
};
};
Expand Down Expand Up @@ -1170,6 +1172,7 @@
PRODUCT_NAME = Spine;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand All @@ -1191,6 +1194,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.wardvanteijlingen.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Spine;
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand All @@ -1210,6 +1214,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.wardvanteijlingen.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand All @@ -1225,6 +1230,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.wardvanteijlingen.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand Down
10 changes: 5 additions & 5 deletions Spine/Routing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class JSONAPIRouter: Router {
public init() { }

public func URLForResourceType(type: ResourceType) -> NSURL {
return baseURL.URLByAppendingPathComponent(type)
return baseURL.URLByAppendingPathComponent(type)!
}

public func URLForRelationship<T: Resource>(relationship: Relationship, ofResource resource: T) -> NSURL {
Expand All @@ -76,8 +76,8 @@ public class JSONAPIRouter: Router {

let resourceURL = resource.URL ?? URLForResourceType(resource.resourceType).URLByAppendingPathComponent("/\(resource.id!)")
let key = keyFormatter.format(relationship)
let urlString = resourceURL.URLByAppendingPathComponent("/relationships/\(key)").absoluteString
return NSURL(string: urlString, relativeToURL: baseURL)
let urlString = resourceURL!.URLByAppendingPathComponent("/relationships/\(key)")!.absoluteString
return NSURL(string: urlString!, relativeToURL: baseURL)!
}


Expand Down Expand Up @@ -137,9 +137,9 @@ public class JSONAPIRouter: Router {
let fieldName = filter.leftExpression.keyPath
var item: NSURLQueryItem?
if let field = T.fieldNamed(fieldName) {
item = queryItemForFilter(field, value: filter.rightExpression.constantValue, operatorType: filter.predicateOperatorType)
item = queryItemForFilter(field, value: filter.rightExpression.constantValue!, operatorType: filter.predicateOperatorType)
} else {
item = queryItemForFilterName(fieldName, value: filter.rightExpression.constantValue, operatorType: filter.predicateOperatorType)
item = queryItemForFilterName(fieldName, value: filter.rightExpression.constantValue!, operatorType: filter.predicateOperatorType)
}
setQueryItem(item!, forQueryItems: &queryItems)
}
Expand Down
2 changes: 1 addition & 1 deletion Spine/ValueFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private struct URLValueFormatter: ValueFormatter {
}

func format(value: NSURL, attribute: URLAttribute) -> AnyObject {
return value.absoluteString
return value.absoluteString ?? ""
}
}

Expand Down