-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from bustoutsolutions/directory-reorg
Separate SiestaUI module & directory reorg
- Loading branch information
Showing
46 changed files
with
513 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
PODS: | ||
- Siesta (1.0-beta.9): | ||
- Siesta/Core (= 1.0-beta.9) | ||
- Siesta/Core (1.0-beta.9) | ||
- Siesta/UI (1.0-beta.9): | ||
- Siesta/Core | ||
- SwiftyJSON (2.3.2) | ||
|
||
DEPENDENCIES: | ||
- Siesta (from `../..`) | ||
- Siesta/UI (from `../..`) | ||
- SwiftyJSON | ||
|
||
EXTERNAL SOURCES: | ||
Siesta: | ||
:path: "../.." | ||
|
||
SPEC CHECKSUMS: | ||
Siesta: 2c1e487b36d88060477eb0458d43a38d8b0bd959 | ||
Siesta: 6405fa1f80105e1614c42a37dcd79806f99bf23c | ||
SwiftyJSON: 04ccea08915aa0109039157c7974cf0298da292a | ||
|
||
PODFILE CHECKSUM: 1b049ab49e1e4cfa3e646e34135423a20b163fb4 | ||
PODFILE CHECKSUM: 185541f66e3c53d1269ded59a72f9c99e6a2d105 | ||
|
||
COCOAPODS: 1.1.0.beta.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
Source/PipelineConfiguration.swift → ...esta/Pipeline/PipelineConfiguration.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Pipeline.swift | ||
// PipelineConfiguration.swift | ||
// Siesta | ||
// | ||
// Created by Paul on 2016/6/3. | ||
|
2 changes: 1 addition & 1 deletion
2
Source/PipelineProcessing.swift → .../Siesta/Pipeline/PipelineProcessing.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Processing.swift | ||
// PipelineProcessing.swift | ||
// Siesta | ||
// | ||
// Created by Paul on 2016/8/7. | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
// | ||
// ResourceNavigation.swift | ||
// Siesta | ||
// | ||
// Created by Paul on 2016/8/16. | ||
// Copyright © 2016 Bust Out Solutions. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Resource | ||
{ | ||
// MARK: URL navigation | ||
|
||
/** | ||
Returns the resource with the given string appended to the path of this resource’s URL, with a joining slash | ||
inserted if necessary. | ||
Use this method for hierarchical resource navigation. The typical use case is constructing a resource URL from | ||
path components and IDs: | ||
let resource = service.resource("/widgets") | ||
resource.child("123").child("details") | ||
//→ /widgets/123/details | ||
This method _always_ returns a subpath of the receiving resource. It does not apply any special | ||
interpretation to strings such `./`, `//` or `?` that have significance in other URL-related | ||
situations. Special characters are escaped when necessary, and otherwise ignored. See | ||
[`ResourcePathsSpec`](https://bustoutsolutions.github.io/siesta/specs/#ResourcePathsSpec) | ||
for details. | ||
- SeeAlso: `relative(_:)` | ||
*/ | ||
@warn_unused_result | ||
public func child(subpath: String) -> Resource | ||
{ | ||
return service.resource(absoluteURL: url.URLByAppendingPathComponent(subpath)) | ||
} | ||
|
||
/** | ||
Returns the resource with the given URL, using this resource’s URL as the base if it is a relative URL. | ||
This method interprets strings such as `.`, `..`, and a leading `/` or `//` as relative URLs. It resolves its | ||
parameter much like an `href` attribute in an HTML document. Refer to | ||
[`ResourcePathsSpec`](https://bustoutsolutions.github.io/siesta/specs/#ResourcePathsSpec) | ||
for details. | ||
- SeeAlso: | ||
- `optionalRelative(_:)` | ||
- `child(_:)` | ||
*/ | ||
@warn_unused_result | ||
public func relative(href: String) -> Resource | ||
{ | ||
return service.resource(absoluteURL: NSURL(string: href, relativeToURL: url)) | ||
} | ||
|
||
/** | ||
Returns `relative(href)` if `href` is present, and nil if `href` is nil. | ||
This convenience method is useful for resolving URLs returned as part of a JSON response body: | ||
let href = resource.jsonDict["owner"] as? String // href is an optional | ||
if let ownerResource = resource.optionalRelative(href) { | ||
// ... | ||
} | ||
*/ | ||
@warn_unused_result | ||
public func optionalRelative(href: String?) -> Resource? | ||
{ | ||
if let href = href | ||
{ return relative(href) } | ||
else | ||
{ return nil } | ||
} | ||
|
||
/** | ||
Returns this resource with the given parameter added or changed in the query string. | ||
If `value` is an empty string, the parameter goes in the query string with no value (e.g. `?foo`). | ||
If `value` is nil, the parameter is removed. | ||
There is no support for parameters with an equal sign but an empty value (e.g. `?foo=`). | ||
There is also no support for repeated keys in the query string (e.g. `?foo=1&foo=2`). | ||
If you need to circumvent either of these restrictions, you can create the query string yourself and pass | ||
it to `relative(_:)` instead of using `withParam(_:_:)`. | ||
Note that `Service` gives out unique `Resource` instances according to the full URL in string form, and thus | ||
considers query string parameter order significant. Therefore, to ensure that you get the same `Resource` | ||
instance no matter the order in which you specify parameters, `withParam(_:_:)` sorts all parameters by name. | ||
Note that _only_ `withParam(_:_:)` does this sorting; if you use other methods to create query strings, it is | ||
up to you to canonicalize your parameter order. | ||
*/ | ||
@warn_unused_result | ||
@objc(withParam:value:) | ||
public func withParam(name: String, _ value: String?) -> Resource | ||
{ | ||
return service.resource(absoluteURL: | ||
url.alterQuery | ||
{ | ||
var params = $0 | ||
params[name] = value | ||
return params | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// SiestaUI.h | ||
// Siesta | ||
// | ||
// Created by Paul on 2015/6/14. | ||
// Copyright © 2016 Bust Out Solutions. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
//! Project version number for SiestaUI. | ||
FOUNDATION_EXPORT double SiestaUIVersionNumber; | ||
|
||
//! Project version string for SiestaUI. | ||
FOUNDATION_EXPORT const unsigned char SiestaUIVersionString[]; | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.