Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Commit

Permalink
Improve ambiguous function names in LoginManager. (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlutsenko authored Nov 7, 2016
1 parent f0fc5ed commit 9af1281
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Samples/Catalog/Sources/LoginManagerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ extension LoginManagerViewController {

@IBAction func loginWithReadPermissions() {
let loginManager = LoginManager()
loginManager.logIn([.publicProfile, .userFriends], viewController: self) { result in
loginManager.logIn(readPermissions: [.publicProfile, .userFriends], viewController: self) { result in
self.loginManagerDidComplete(result)
}
}

@IBAction func loginWithPublishPermissions() {
let loginManager = LoginManager()
loginManager.logIn([.publishActions], viewController: self) { result in
loginManager.logIn(publishPermissions: [.publishActions], viewController: self) { result in
self.loginManagerDidComplete(result)
}
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/Login/LoginManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ public final class LoginManager {
- parameter viewController: Optional view controller to present from. Default: topmost view controller.
- parameter completion: Optional callback.
*/
public func logIn(_ permissions: [ReadPermission] = [.publicProfile],
public func logIn(readPermissions: [ReadPermission] = [.publicProfile],
viewController: UIViewController? = nil,
completion: ((LoginResult) -> Void)? = nil) {
let sdkPermissions = permissions.map({ $0.permissionValue.name })
let sdkPermissions = readPermissions.map({ $0.permissionValue.name })
sdkManager.logIn(withReadPermissions: sdkPermissions,
from: viewController,
handler: LoginManager.sdkCompletionFor(completion))
Expand All @@ -98,10 +98,10 @@ public final class LoginManager {
- parameter viewController: Optional view controller to present from. Default: topmost view controller.
- parameter completion: Optional callback.
*/
public func logIn(_ permissions: [PublishPermission] = [.publishActions],
public func logIn(publishPermissions: [PublishPermission] = [.publishActions],
viewController: UIViewController? = nil,
completion: ((LoginResult) -> Void)? = nil) {
let sdkPermissions = permissions.map({ $0.permissionValue.name })
let sdkPermissions = publishPermissions.map({ $0.permissionValue.name })
sdkManager.logIn(withPublishPermissions: sdkPermissions,
from: viewController,
handler: LoginManager.sdkCompletionFor(completion))
Expand Down

0 comments on commit 9af1281

Please sign in to comment.