提交 576437d0 编写于 作者: S Semen Zhydenko 提交者: Jon Shier

Fix common typos. (#2848)

* aquiring -> acquiring

* didnt -> didn't

* occured -> occurred

* reponse -> response

* recieves -> receives

* recieve -> receive

* Reverted changes in docs
上级 dfd0ac25
......@@ -179,7 +179,7 @@ Released on 2018-12-06. All issues associated with this milestone can be found u
- Added by [Jon Shier](https://github.com/jshier) in Pull Request [#2629](https://github.com/Alamofire/Alamofire/pull/2629).
- Support for `Encodable` parameter types with `JSONParameterEncoder` and `URLEncodedFormParameterEncoder`.
- Added by [Jon Shier](https://github.com/jshier) in Pull Request [#2637](https://github.com/Alamofire/Alamofire/pull/2637).
- Customizable empty reponse handling in response serializers.
- Customizable empty response handling in response serializers.
- Added by [Jon Shier](https://github.com/jshier) in Pull Request [#2639](https://github.com/Alamofire/Alamofire/pull/2639).
- `EventMonitor` protocol, to tap in to internal Alamofire lifetime events.
- Added by [Jon Shier](https://github.com/jshier) in Pull Request [#2521](https://github.com/Alamofire/Alamofire/pull/2521).
......
......@@ -35,7 +35,7 @@ public enum AFError: Error {
case jsonEncodingFailed(error: Error)
}
/// The underlying reason the `.parameterEncoderFailed` error occured.
/// The underlying reason the `.parameterEncoderFailed` error occurred.
public enum ParameterEncoderFailureReason {
/// Possible missing components.
public enum RequiredComponent {
......@@ -115,7 +115,7 @@ public enum AFError: Error {
case responseSerializerAddedAfterRequestFinished
}
/// Underlying reason a server trust evaluation error occured.
/// Underlying reason a server trust evaluation error occurred.
public enum ServerTrustFailureReason {
/// The output of a server trust evaluation.
public struct Output {
......
......@@ -117,7 +117,7 @@ public protocol EventMonitor {
/// Event called when a `Request` fails due to an error created by Alamofire. e.g. When certificat pinning fails.
func request(_ request: Request, didFailTask task: URLSessionTask, earlyWithError error: Error)
/// Event called when a `Request`'s task completes, possibly with an error. A `Request` may recieve this event
/// Event called when a `Request`'s task completes, possibly with an error. A `Request` may receive this event
/// multiple times if it is retried.
func request(_ request: Request, didCompleteTask task: URLSessionTask, with error: Error?)
......@@ -544,7 +544,7 @@ open class ClosureEventMonitor: EventMonitor {
/// Closure called on the `urlSession(_:taskIsWaitingForConnectivity:)` event.
open var taskIsWaitingForConnectivity: ((URLSession, URLSessionTask) -> Void)?
/// Closure that recieves the `urlSession(_:dataTask:didReceive:)` event.
/// Closure that receives the `urlSession(_:dataTask:didReceive:)` event.
open var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)?
/// Closure called on the `urlSession(_:dataTask:willCacheResponse:completionHandler:)` event.
......
......@@ -58,7 +58,7 @@ final class UnfairLock {
return closure()
}
/// Execute a closure while aquiring the lock.
/// Execute a closure while acquiring the lock.
///
/// - Parameter closure: The closure to run.
func around(_ closure: () -> Void) {
......@@ -147,7 +147,7 @@ extension Protector where T == Request.MutableState {
///
/// - Parameter state: The `State` to attempt transition to.
///
/// - Returns: Whether the transtion occured.
/// - Returns: Whether the transtion occurred.
func attemptToTransitionTo(_ state: Request.State) -> Bool {
return lock.around {
guard value.state.canTransitionTo(state) else { return false }
......
......@@ -936,11 +936,11 @@ public class DataRequest: Request {
/// Called to updated the `downloadProgress` of the instance.
func updateDownloadProgress() {
let totalBytesRecieved = Int64(data?.count ?? 0)
let totalBytesReceived = Int64(data?.count ?? 0)
let totalBytesExpected = task?.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown
downloadProgress.totalUnitCount = totalBytesExpected
downloadProgress.completedUnitCount = totalBytesRecieved
downloadProgress.completedUnitCount = totalBytesReceived
downloadProgressHandler?.queue.async { self.downloadProgressHandler?.handler(self.downloadProgress) }
}
......
......@@ -367,7 +367,7 @@ extension DataRequest {
}
}
/// A `ResponseSerializer` that performs minimal reponse checking and returns any response data as-is. By default, a
/// A `ResponseSerializer` that performs minimal response checking and returns any response data as-is. By default, a
/// request returning `nil` or no data is considered an error. However, if the response is has a status code valid for
/// empty responses (`204`, `205`), then an empty `Data` value is returned.
public final class DataResponseSerializer: ResponseSerializer {
......
......@@ -78,7 +78,7 @@ class ProxyURLProtocol: URLProtocol {
// MARK: Loading Methods
override func startLoading() {
// rdar://26849668 - URLProtocol had some API's that didnt make the value type conversion
// rdar://26849668 - URLProtocol had some API's that didn't make the value type conversion
let urlRequest = (request.urlRequest! as NSURLRequest).mutableCopy() as! NSMutableURLRequest
URLProtocol.setProperty(true, forKey: PropertyKeys.handledByForwarderURLProtocol, in: urlRequest)
activeTask = session.dataTask(with: urlRequest as URLRequest)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册