 import MobileCoreServices
 
 public struct MultiAuthService {
-    
-    // MARK: - Public properties
-    
-    public var handler: ((username: String?, password: String?, errorMessage: String?) -> ())?
-    
     
     // MARK: - Internal constants
     

    
    static func recordLogInViaSharedCredentials() {
        NSUserDefaults.standardUserDefaults().setBool(true, forKey: logInViaSharedCredentialsKey)
        NSUserDefaults.standardUserDefaults().synchronize()
    }
    
}

    
    
    // MARK: - Public API
        
    public func retrieveCredentialsFromActivityViewController(urlString: String, fromViewController viewController: UIViewController, sender: AnyObject, storedHandler: (username: String?, password: String?, errorMessage: String?) -> ()) {
        let activityViewController = configuredActivityViewController(urlString, sender: sender, handler: storedHandler)
        activityViewController.completionWithItemsHandler = { activityType, completed, returnedItems, activityError in
            if let returnedItems = returnedItems, extensionItem = returnedItems.first as? NSExtensionItem, itemProvider = extensionItem.attachments?.first as? NSItemProvider where itemProvider.hasItemConformingToTypeIdentifier(kUTTypePropertyList as String) {
                itemProvider.loadItemForTypeIdentifier(kUTTypePropertyList as String, options: nil) { itemDictionary, itemProviderError in
                    if let itemDictionary = itemDictionary as? [String: String] where itemProviderError == nil {
                        let username = itemDictionary[MultiAuthService.usernameKey]
                        let password = itemDictionary[MultiAuthService.passwordKey]
                        storedHandler(username: username, password: password, errorMessage: nil)
                    } else {
                        print("status=failed-to-load-item error=\(itemProviderError)")
                    }
                }
            } else {
                print("status=failed-to-find-login URLString=\(urlString) error=\(activityError)")
                storedHandler(username: nil, password: nil, errorMessage: nil)
            }
        }
        viewController.presentViewController(activityViewController, animated: true, completion: nil)
