From bb58af1e1bbb72388f315c51d60839b1c0c901fe Mon Sep 17 00:00:00 2001 From: Florian Morello Date: Wed, 5 Oct 2016 23:46:45 +0200 Subject: [PATCH] Fixed documentation and unified casts to `Any` instead of `AnyObject` (#69) * Use Any instead of AnyObject * Fix comments GraphAPIVersion.Default > GraphAPIVersion.defaultVersion * Former FBSDKAppEvents.setPushNotificationsDeviceToken Added as AppEventsLogger.setPushNotifications(deviceToken: Data!) * remove push from PR --- Samples/Catalog/Sources/GraphAPIReadViewController.swift | 2 +- Sources/Core/GraphRequest/GraphRequest.swift | 2 +- Sources/Core/GraphRequest/GraphRequestProtocol.swift | 2 +- Sources/Core/GraphRequest/GraphResponse.swift | 2 +- Sources/Core/UserProfile/UserProfile.swift | 2 +- Sources/Share/Content/OpenGraph/OpenGraphPropertyValue.swift | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Samples/Catalog/Sources/GraphAPIReadViewController.swift b/Samples/Catalog/Sources/GraphAPIReadViewController.swift index 2c8107e3..7cdf9285 100644 --- a/Samples/Catalog/Sources/GraphAPIReadViewController.swift +++ b/Samples/Catalog/Sources/GraphAPIReadViewController.swift @@ -45,7 +45,7 @@ struct FBProfileRequest: GraphRequestProtocol { typealias Response = GraphResponse var graphPath = "/me" - var parameters: [String : Any]? = ["fields": "id, name" as AnyObject] + var parameters: [String : Any]? = ["fields": "id, name"] var accessToken = AccessToken.current var httpMethod: GraphRequestHTTPMethod = .GET var apiVersion: GraphAPIVersion = 2.7 diff --git a/Sources/Core/GraphRequest/GraphRequest.swift b/Sources/Core/GraphRequest/GraphRequest.swift index d1d48756..a4aebded 100644 --- a/Sources/Core/GraphRequest/GraphRequest.swift +++ b/Sources/Core/GraphRequest/GraphRequest.swift @@ -45,7 +45,7 @@ public struct GraphRequest: GraphRequestProtocol { /// The `HTTPMethod` to use for the request, e.g. `.GET`/`.POST`/`.DELETE`. public let httpMethod: GraphRequestHTTPMethod - /// Graph API Version to use, e.g. `"2.7"`. Default: `GraphRequestDefaultAPIVersion`. + /// Graph API Version to use, e.g. `"2.7"`. Default: `GraphAPIVersion.defaultVersion`. public let apiVersion: GraphAPIVersion /** diff --git a/Sources/Core/GraphRequest/GraphRequestProtocol.swift b/Sources/Core/GraphRequest/GraphRequestProtocol.swift index 58dc1816..f865a3f9 100644 --- a/Sources/Core/GraphRequest/GraphRequestProtocol.swift +++ b/Sources/Core/GraphRequest/GraphRequestProtocol.swift @@ -49,7 +49,7 @@ public protocol GraphRequestProtocol { /// The `HTTPMethod` to use for the request, e.g. `.GET`/`.POST`/`.DELETE`. var httpMethod: GraphRequestHTTPMethod { get } - /// Graph API Version to use. Default: `GraphAPIVersion.Default`. + /// Graph API Version to use. Default: `GraphAPIVersion.defaultVersion`. var apiVersion: GraphAPIVersion { get } } diff --git a/Sources/Core/GraphRequest/GraphResponse.swift b/Sources/Core/GraphRequest/GraphResponse.swift index 78d13731..9d41762e 100644 --- a/Sources/Core/GraphRequest/GraphResponse.swift +++ b/Sources/Core/GraphRequest/GraphResponse.swift @@ -43,7 +43,7 @@ public struct GraphResponse: GraphResponseProtocol { } /** - Converts and returns a response in a form of `Array` + Converts and returns a response in a form of `Array` If the conversion fails or there is was response - returns `nil`. */ public var arrayValue: [Any]? { diff --git a/Sources/Core/UserProfile/UserProfile.swift b/Sources/Core/UserProfile/UserProfile.swift index 1145a3c1..5ebfaede 100644 --- a/Sources/Core/UserProfile/UserProfile.swift +++ b/Sources/Core/UserProfile/UserProfile.swift @@ -105,7 +105,7 @@ extension UserProfile { */ public static func fetch(userId: String, completion: @escaping Completion) { let request = GraphRequest(graphPath: userId, - parameters: ["fields" : "first_name,middle_name,last_name,name,link" as AnyObject], + parameters: ["fields" : "first_name,middle_name,last_name,name,link"], httpMethod: .GET) request.start { (httpResponse, result) in switch result { diff --git a/Sources/Share/Content/OpenGraph/OpenGraphPropertyValue.swift b/Sources/Share/Content/OpenGraph/OpenGraphPropertyValue.swift index 579eb76a..7d3deb0f 100644 --- a/Sources/Share/Content/OpenGraph/OpenGraphPropertyValue.swift +++ b/Sources/Share/Content/OpenGraph/OpenGraphPropertyValue.swift @@ -32,7 +32,7 @@ internal struct OpenGraphPropertyValueConverter { switch value { case let value as String: return value case let value as NSNumber: return value - case let value as NSArray: return value.flatMap { valueFrom(openGraphObjectValue: $0 as AnyObject) } + case let value as NSArray: return value.flatMap { valueFrom(openGraphObjectValue: $0 as Any) } case let value as URL: return value case let value as FBSDKSharePhoto: return Photo(sdkPhoto: value) case let value as FBSDKShareOpenGraphObject: return OpenGraphObject(sdkGraphObject: value)