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

Improve ambiguous logIn() function names in LoginManager. #97

Merged
merged 1 commit into from
Nov 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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