Skip to content

Commit

Permalink
Fix @escaping compilation errors introduced in Swift 3 GM
Browse files Browse the repository at this point in the history
  • Loading branch information
meteochu committed Sep 9, 2016
1 parent 85a9f62 commit 23b3cff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Swifter/SwifterAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public extension Swifter {
}, failure: failure)
}

public func postOAuthRequestToken(with callbackURL: URL, success: TokenSuccessHandler, failure: FailureHandler?) {
public func postOAuthRequestToken(with callbackURL: URL, success: @escaping TokenSuccessHandler, failure: FailureHandler?) {
let path = "oauth/request_token"
let parameters: [String: Any] = ["oauth_callback": callbackURL.absoluteString]

Expand All @@ -169,7 +169,7 @@ public extension Swifter {
}, failure: failure)
}

public func postOAuthAccessToken(with requestToken: Credential.OAuthAccessToken, success: TokenSuccessHandler, failure: FailureHandler?) {
public func postOAuthAccessToken(with requestToken: Credential.OAuthAccessToken, success: @escaping TokenSuccessHandler, failure: FailureHandler?) {
if let verifier = requestToken.verifier {
let path = "oauth/access_token"
let parameters: [String: Any] = ["oauth_token": requestToken.key, "oauth_verifier": verifier]
Expand Down
2 changes: 1 addition & 1 deletion Swifter/SwifterSearch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public extension Swifter {
In API v1.1, the response format of the Search API has been improved to return Tweet objects more similar to the objects you’ll find across the REST API and platform. However, perspectival attributes (fields that pertain to the perspective of the authenticating user) are not currently supported on this endpoint.
*/
public func searchTweet(using query: String, geocode: String? = nil, lang: String? = nil, locale: String? = nil, resultType: String? = nil, count: Int? = nil, until: String? = nil, sinceID: String? = nil, maxID: String? = nil, includeEntities: Bool? = nil, callback: String? = nil, success: ((JSON, _ searchMetadata: JSON) -> Void)? = nil, failure: FailureHandler) {
public func searchTweet(using query: String, geocode: String? = nil, lang: String? = nil, locale: String? = nil, resultType: String? = nil, count: Int? = nil, until: String? = nil, sinceID: String? = nil, maxID: String? = nil, includeEntities: Bool? = nil, callback: String? = nil, success: ((JSON, _ searchMetadata: JSON) -> Void)? = nil, failure: @escaping FailureHandler) {
let path = "search/tweets.json"

var parameters = Dictionary<String, Any>()
Expand Down
14 changes: 7 additions & 7 deletions Swifter/SwifterUsers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public extension Swifter {
Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com. Each parameter's value must be a valid hexidecimal value, and may be either three or six characters (ex: #fff or #ffffff).
*/
public func updateProfileColors(backgroundColor: String? = nil, linkColor: String? = nil, sidebarBorderColor: String? = nil, sidebarFillColor: String? = nil, textColor: String? = nil, includeEntities: Bool? = nil, skipStatus: Bool? = nil, success: SuccessHandler? = nil, failure: FailureHandler) {
public func updateProfileColors(backgroundColor: String? = nil, linkColor: String? = nil, sidebarBorderColor: String? = nil, sidebarFillColor: String? = nil, textColor: String? = nil, includeEntities: Bool? = nil, skipStatus: Bool? = nil, success: SuccessHandler? = nil, failure: @escaping FailureHandler) {
let path = "account/update_profile_colors.json"

var parameters = Dictionary<String, Any>()
Expand Down Expand Up @@ -175,7 +175,7 @@ public extension Swifter {
Returns an array of numeric user ids the authenticating user is blocking.
*/
public func getBlockedUsersIDs(stringifyIDs: String? = nil, cursor: String? = nil, success: CursorSuccessHandler? = nil, failure: FailureHandler) {
public func getBlockedUsersIDs(stringifyIDs: String? = nil, cursor: String? = nil, success: CursorSuccessHandler? = nil, failure: @escaping FailureHandler) {
let path = "blocks/ids.json"

var parameters = Dictionary<String, Any>()
Expand All @@ -192,7 +192,7 @@ public extension Swifter {
Blocks the specified user from following the authenticating user. In addition the blocked user will not show in the authenticating users mentions or timeline (unless retweeted by another user). If a follow or friend relationship exists it is destroyed.
*/
public func blockUser(for userTag: UserTag, includeEntities: Bool? = nil, skipStatus: Bool? = nil, success: SuccessHandler? = nil, failure: FailureHandler) {
public func blockUser(for userTag: UserTag, includeEntities: Bool? = nil, skipStatus: Bool? = nil, success: SuccessHandler? = nil, failure: @escaping FailureHandler) {
let path = "blocks/create.json"

var parameters = Dictionary<String, Any>()
Expand All @@ -208,7 +208,7 @@ public extension Swifter {
Un-blocks the user specified in the ID parameter for the authenticating user. Returns the un-blocked user in the requested format when successful. If relationships existed before the block was instated, they will not be restored.
*/
public func unblockUser(for userTag: UserTag, includeEntities: Bool? = nil, skipStatus: Bool? = nil, success: SuccessHandler? = nil, failure: FailureHandler) {
public func unblockUser(for userTag: UserTag, includeEntities: Bool? = nil, skipStatus: Bool? = nil, success: SuccessHandler? = nil, failure: @escaping FailureHandler) {
let path = "blocks/destroy.json"

var parameters = Dictionary<String, Any>()
Expand Down Expand Up @@ -236,7 +236,7 @@ public extension Swifter {
- If none of your lookup criteria can be satisfied by returning a user object, a HTTP 404 will be thrown.
- You are strongly encouraged to use a POST for larger requests.
*/
public func lookupUsers(for usersTag: UsersTag, includeEntities: Bool? = nil, success: SuccessHandler? = nil, failure: FailureHandler) {
public func lookupUsers(for usersTag: UsersTag, includeEntities: Bool? = nil, success: SuccessHandler? = nil, failure: @escaping FailureHandler) {
let path = "users/lookup.json"

var parameters = Dictionary<String, Any>()
Expand All @@ -253,7 +253,7 @@ public extension Swifter {
You must be following a protected user to be able to see their most recent Tweet. If you don't follow a protected user, the users Tweet will be removed. A Tweet will not always be returned in the current_status field.
*/
public func showUser(for userTag: UserTag, includeEntities: Bool? = nil, success: SuccessHandler? = nil, failure: FailureHandler) {
public func showUser(for userTag: UserTag, includeEntities: Bool? = nil, success: SuccessHandler? = nil, failure: @escaping FailureHandler) {
let path = "users/show.json"

var parameters = Dictionary<String, Any>()
Expand All @@ -270,7 +270,7 @@ public extension Swifter {
Only the first 1,000 matching results are available.
*/
public func searchUsers(using query: String, page: Int?, count: Int?, includeEntities: Bool?, success: SuccessHandler? = nil, failure: FailureHandler) {
public func searchUsers(using query: String, page: Int?, count: Int?, includeEntities: Bool?, success: SuccessHandler? = nil, failure: @escaping FailureHandler) {
let path = "users/search.json"

var parameters = Dictionary<String, Any>()
Expand Down

0 comments on commit 23b3cff

Please sign in to comment.