We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
OHHTTPStubs
The example on Usage Examples page is shown as follows:
// Swift OHHTTPStubs.onStubActivation() { request, stub in println("\(request.URL!) stubbed by \(stub.name).") }
Problem 1: Signature of onStubActivation was changed a few versions ago. So it should be:
onStubActivation
OHHTTPStubs.onStubActivation() { request, stub, response in
This problem applies to both, Swift and Objective C examples
Problem 2: replace println with print in Swift, as there's no println function in swift.
println
print
Problem 3: in Swift, NSURLRequest is bridged as URLRequest, and instead of request.URL!, it uses lower-cased request.url!
NSURLRequest
URLRequest
request.URL!
request.url!
Bottom line: example in Swift should look something like this:
// Swift OHHTTPStubs.onStubActivation() { request, stub, response in print("\(request.url!) stubbed by \(stub.name) of size \(response.dataSize).") }
This is documentation update issue, so not applicable.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
New Issue Checklist
OHHTTPStubs
for your project sectionEnvironment
Issue Description
The example on Usage Examples page is shown as follows:
Problem 1: Signature of
onStubActivation
was changed a few versions ago. So it should be:This problem applies to both, Swift and Objective C examples
Problem 2: replace
println
withprint
in Swift, as there's no println function in swift.Problem 3: in Swift,
NSURLRequest
is bridged asURLRequest
, and instead ofrequest.URL!
, it uses lower-casedrequest.url!
Bottom line: example in Swift should look something like this:
Complete output when you encounter the issue (if any)
This is documentation update issue, so not applicable.
The text was updated successfully, but these errors were encountered: