Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session delegate (Alamofire) support - closes #11, closes #12 #41

Closed
wants to merge 3 commits into from

Conversation

srdanrasic
Copy link

  • Adds support for data task delegate
  • Adds support for download task delegate
  • Adds .gitignore
  • Sets 4 space tab setting on project file

This enables DVR to work with Alamofire.

let delegate = Manager.SessionDelegate()
let session = Session(cassetteName: "example", delegate: delegate)
let manager = Manager(session: session, delegate: delegate)

@srdanrasic srdanrasic changed the title Session delegate support - closes #11, closes #12 Session delegate (Alamofire) support - closes #11, closes #12 Dec 29, 2015
@dgdosen
Copy link
Contributor

dgdosen commented Jan 15, 2016

Can you clarify why you need to create and manage task ids?

@srdanrasic
Copy link
Author

Because NSURLSessionDataTask/NSURLSessionTask does not implement taskIdentifier property.

If you try executing

let task = NSURLSessionDataTask()
print(task.taskIdentifier)

your program will crash. I guess under the hood it's implemented as Objective-C @dynamic property.

That's why I need to handle task identifiers and other properties that I've overridden manually.

@phatmann
Copy link

phatmann commented Mar 8, 2016

Can Alamofire be used with DVR even without this PR? Supposedly this Alamofire PR allows DVR to be used with it.

@hugobast
Copy link

@phatmann the Alamofire PR you mention is absolutely advancing the goal of DVR + Alamofire. What it does is add a failable init to configure a Manager with a different Session. That's great and it works great. On DVR's side there are things required in order to work:

Let me know if I can do anything to advance this PR and give it a chance to be merged. It would be great to have that Alamofire supported.

@nebiros
Copy link

nebiros commented Jan 11, 2018

Got the same error as @srdanrasic:

"-[DVR.SessionDataTask taskIdentifier]: unrecognized selector sent to instance 0x60b000064a60"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants