Questions tagged [siesta-swift]

Use [siesta-swift] for questions about the Siesta REST library for iOS. For the Javascript unit testing tool, use the tag [siesta].

Siesta is a REST framework for iOS apps. It provides a resource-centric alternative to the familiar request-centric approach to networking.

67 questions
2
votes
1 answer

Cocoapods No such module 'Siesta'

I've just installed Siesta (1.0-beta.4) using cocoapods, but when I try to import it with import Siesta inside a swift file I receive this error: No such module 'Siesta' This is my Podfile: platform :ios, '8.0' use_frameworks! pod 'Siesta',…
lifeisfoo
  • 15,478
  • 6
  • 74
  • 115
2
votes
1 answer

Observing multiple Resources in Siesta

In my class I have multiple Resource Siesta objects that I want all loaded with data before I populate the table view and enable user input. Here's the code: var trainees: Resource? { didSet { oldValue?.removeObservers(ownedBy: self) …
Rhuantavan
  • 445
  • 3
  • 17
2
votes
1 answer

Siesta iOS POST request errors out with "unsupported URL"

I am having trouble with Siesta - an iOS REST Client Framework https://bustoutsolutions.github.io/siesta/. Below is a simple example of a POST request to a REST API server, which fails with a "unsupported URL" error. Does anybody out there have any…
Rhuantavan
  • 445
  • 3
  • 17
1
vote
1 answer

How to make the response object that another ViewController's post request returns append to a TableViewController with Siesta Swift

I am a Swift beginner so apologies. With Siesta, I want to make a post request in a ViewController and then have the Entry object the request returns added to the TableViewController. In my ViewController: EntryAPI.sharedInstance.addEntry() The API…
1
vote
0 answers

Swift Siesta transformer pipeline distinguish between `/path/{id}` and `/path/special-token`

Suppose I am setting up my transformers and need to handle two similar API routes that return different object schemas, e.g. /beers/{id} -> [Beer] /beers/grouped-by-country -> [Country:Beer] It seems Siesta is unable to distinguish…
1
vote
1 answer

Siesta loading fails on stale resources

When I start my app (simulator or on phone) after some time has passed (e.g. some hours), Siesta won't load my resources and the statusOverlay() will be shown indefinitely. In detail, I have a HomeViewController, which issues the following request…
Jan
  • 33
  • 3
1
vote
1 answer

How to decorate Siesta request with an asynchronous task

What is the correct way to alter a Request performing an asynchronous task before the Request happens? So any request Rn need to become transparently Tn then Rn. A little of background here: The Task is a 3rd party SDK that dispatch a Token I need…
Gabriele
  • 1,163
  • 1
  • 11
  • 24
1
vote
1 answer

ios swift siesta ResourceObserver resourceRequestProgress never called

I am using Siesta for REST calls and I am trying to create a simple ResourceObserver to display a SVProgressHUD. open class SVProgressHUDResourceObserver: ResourceObserver { static let sharedInstance = SVProgressHUDResourceObserver() //…
bludginozzie
  • 119
  • 2
  • 10
1
vote
2 answers

Is it possible to specify a cache policy?

Is it possible in Siesta to use a cache policy like: LocalOnly NetworkFirst Where LocalOnly is getting the data from the local cache only, and NetworkFirst is getting the data from the network, and if it fails, retrieve from local cache.
RPallas
  • 557
  • 7
  • 22
1
vote
1 answer

Does Siesta support HTTP long polling

I have an API endpoint which responds with an endless sequence of JSON objects. Like GET /commands?since=112233 {"cmd": "mycommand", "params": [...]} {"cmd": "othercommand", "params": [...]} ... The session almost never ends (the server has a…
kikap
  • 832
  • 11
  • 14
1
vote
1 answer

Using Siesta with a non-restful API

I know this is probably a long-shot, but is it possible to use Siesta with a completely non-RESTful API? The API I have to work with (and is not in my control so sadly cannot change) requires every request to be a POST request regardless of whether…
PaReeOhNos
  • 4,338
  • 3
  • 30
  • 41
1
vote
1 answer

Getting an AuthToken using Siesta via Password Grant

new to both Swift and Siesta... Trying to make a "password" grant type request. I used the code located here (the block at the very bottom). My code is: var authToken: String?? var tokenCreationResource: Resource { return resource("oauth/v2/token")…
snoop168
  • 394
  • 3
  • 16
1
vote
1 answer

Initialisation of Realm objects from JSON built upon Siesta Entity fails

I am using Siesta to fetch resources from my server. And I am following the user guide to configure a transformer to automatically transform JSON strings into Realm objects. It works for single objects, but somehow, fails with arrays of such…
onekiloparsec
  • 2,013
  • 21
  • 32
1
vote
1 answer

Swift structs: no type named 'Business' in module

I'm building a project using Swift 3 and Xcode 8.1. First I created an API client using Siesta on a framework and I'm including it on my mail project, but when I try to use an struct from the framework to do a downcast I get an error No type named…
SkarXa
  • 1,184
  • 1
  • 12
  • 24
1
vote
1 answer

cache multiple resources from a single request

Let's say I'm making a request for /products.json which returns a JSON array with X number of products. Each is available at /product/[id].json. Is it possible to make siesta cache that information instead of making a request for each product? Or do…
Mark Lilback
  • 1,154
  • 9
  • 21