Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save embassem/14fd16307bedb7b20790fe5933a1d2c7 to your computer and use it in GitHub Desktop.
Save embassem/14fd16307bedb7b20790fe5933a1d2c7 to your computer and use it in GitHub Desktop.
use AccessTokenAuthorizable with MultiTarget
extension MultiTarget: AccessTokenAuthorizable {
public var authorizationType: AuthorizationType {
// here you will have to check whether the `target` is also conforming to `AccessTokenAuthorizable` or not...
if target is AccessTokenAuthorizable {
guard let authTarget = target as? AccessTokenAuthorizable else {
return .none
}
return authTarget.authorizationType
}
return .none
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment