Browse Source

Added URLRequest URLStringConvertible conformance removal to migration guide.

Christian Noon 9 years ago
parent
commit
03aa9f26eb
1 changed files with 19 additions and 0 deletions
  1. 19 0
      Documentation/Alamofire 4.0 Migration Guide.md

+ 19 - 0
Documentation/Alamofire 4.0 Migration Guide.md

@@ -9,6 +9,7 @@ This guide is provided in order to ease the transition of existing applications
 - [Breaking API Changes](#breaking-api-changes)
 - [Breaking API Changes](#breaking-api-changes)
 	- [Namespace Changes](#namespace-changes)
 	- [Namespace Changes](#namespace-changes)
 	- [Making Requests](#making-requests)
 	- [Making Requests](#making-requests)
+	- [URLStringConvertible Conformance](#urlstringconvertible-conformance)
 - [New Features](#new-features)
 - [New Features](#new-features)
 	- [Request Adapter](#request-adapter)
 	- [Request Adapter](#request-adapter)
 	- [Request Retrier](#request-retrier)
 	- [Request Retrier](#request-retrier)
@@ -284,6 +285,24 @@ Alamofire.upload(fileURL, to: urlString, method: .put)
 
 
 As you can see, there are many breaking API changes, but the common APIs still adhere to the original design goals of being able to make complex requests through a single line of code in a concise, well defined manner.
 As you can see, there are many breaking API changes, but the common APIs still adhere to the original design goals of being able to make complex requests through a single line of code in a concise, well defined manner.
 
 
+### URLStringConvertible Conformance
+
+The `URLRequest` no longer conforms to the `URLStringConvertible` protocol. This was always a bit of a stretch in the previous versions of Alamofire and wasn't really necessary. It also had a high potential to introduce ambiguity into many Alamofire APIs. Because of these reasons, `URLRequest` no longer conforms to `URLStringConvertible`.
+
+What this means in code is that you can no longer do the following:
+
+```swift
+let urlRequest = URLRequest(url: URL(string: "https://httpbin.org/get")!)
+let urlString = urlRequest.urlString
+```
+
+Instead, in Alamofire 4, you now have to do the following:
+
+```swift
+let urlRequest = URLRequest(url: URL(string: "https://httpbin.org/get")!)
+let urlString = urlRequest.url?.urlString
+```
+
 ---
 ---
 
 
 ## New Features
 ## New Features