-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ivan Rep
committed
Aug 19, 2016
1 parent
71c041b
commit d36eff4
Showing
20 changed files
with
170 additions
and
200 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+1.29 KB
(100%)
...ntDataAccess.xcworkspace/xcuserdata/undabotrep.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
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.
3 changes: 2 additions & 1 deletion
3
...aAccess/TestGateways/TracksInFlight.swift → ...aAccess/TestGateways/TracksInFlight.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
This file was deleted.
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.
20 changes: 20 additions & 0 deletions
20
TransparentDataAccess/TransparentDataAccess/Gateways/Gateway.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import RxSwift | ||
import Moya | ||
|
||
/// Target that can be stored using default gateways | ||
protocol StorableType { | ||
var key: String { get } | ||
} | ||
|
||
/// Get gateway interface | ||
class GetGateway<R, T> { | ||
func getResource(resourceType: T, forceRefresh: Bool = false) -> Observable<R> { | ||
return Observable.empty() | ||
} | ||
} | ||
|
||
/// GetSet gateway interface | ||
class GetSetGateway<R, T: StorableType>: GetGateway<R, T> { | ||
func setResource(resourceType: T, resource: R) { | ||
} | ||
} |
9 changes: 5 additions & 4 deletions
9
...ansparentDataAccess/KeychainGateway.swift → ...DataAccess/Gateways/KeychainGateway.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
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,15 @@ | ||
import Moya | ||
|
||
extension String { | ||
var URLEscapedString: String { | ||
return self.stringByAddingPercentEncodingWithAllowedCharacters( | ||
NSCharacterSet.URLHostAllowedCharacterSet())! | ||
} | ||
var UTF8EncodedData: NSData { | ||
return self.dataUsingEncoding(NSUTF8StringEncoding)! | ||
} | ||
} | ||
|
||
public func url(route: TargetType) -> String { | ||
return route.baseURL.URLByAppendingPathComponent(route.path).absoluteString | ||
} |
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
Oops, something went wrong.