Files
OAuthSwift/Sources/Handler/ExtensionContextURLHandler.swift
phimage e14ac9cbff Move each url handler to its own file
Add a factory to choose default one
Add to iOS demo app the `ASWebAuthentifcationURLHandler`
2019-11-01 22:36:13 +01:00

24 lines
575 B
Swift

//
// ExtensionContextURLHandler.swift
// OAuthSwift
//
// Created by phimage on 01/11/2019.
// Copyright © 2019 Dongri Jin, Marchand Eric. All rights reserved.
//
import Foundation
/// Open url using `NSExtensionContext``
open class ExtensionContextURLHandler: OAuthSwiftURLHandlerType {
fileprivate var extensionContext: NSExtensionContext
public init(extensionContext: NSExtensionContext) {
self.extensionContext = extensionContext
}
@objc open func handle(_ url: URL) {
extensionContext.open(url, completionHandler: nil)
}
}