A common place for our Networking code. Since Swift 4.0 this can be very straight forward with the
Codable protocol. More info on WWWDC 2017 session video: New in Founcation
Our goal with Faro is:
- Decode objects from JSON data returned from any service.
- Easy to debug errors and logs in the console
- Simplify security setup
Faro makes heavy use of Asynchronous Throwing. Why this is can be found a a super post from 2015 from @terhechte https://appventure.me/2015/06/19/swift-try-catch-asynchronous-closures/
- iOS 10 and Swift 4.0
- Because we use generics you can only use this pod in Swift only files. You can mix and Match with Objective-C but not with generic classes. Types More info
Add following line to your Cartfile.
Then I recomend adding Faro as a sub project or in your workspace. This will always build for the correct target and with correct signing without stripping scripts.
cd Sources carthage update --no-build # Add Sources/Faro/Faro.xcodeproject to your project/workspace # Add Carthage/ZFile/Sources/ZFile.xcodeproject to your project/workspace # Embed Faro in your app. (choose iOS or macOS) # Embed ZFile in your app. (choose iOS or macOS)
I use github.com/dooZDev/Highway to automate things. To run it do.
swift package update # uncomment if you want to change the Higway executable # swift package generate-xcodeproj swift build
Please do 👍
Faro is available under the MIT license. See the LICENSE file for more info.
Help us keep the lights on
1.2.0 - Apr 16, 2019
Added xcodeproj for iOS 10.0 until swift package manager supports iOS
1.1 - Jan 2, 2019
- Use playground to checkout Faro on macOS
- Use the DistinctServiceForType to get a result only once or when it is changed
In RX terms this is calls this distinct
1.0.2 - Dec 31, 2018
1.0 - Dec 29, 2018
- perform a network request
- stub routes
- Mock the Service
- Use it with RxSwift