Skip to content

Commit

Permalink
Merge pull request #5 from nuomi1/feature/WeiboHandler
Browse files Browse the repository at this point in the history
feat: openURL
  • Loading branch information
nuomi1 authored Jan 27, 2021
2 parents 2eb182f + 6d6813e commit 4e0a5c6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions NBus/Classes/Handler/WeiboHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,25 @@ extension WeiboHandler {
}
}

extension WeiboHandler: OpenURLHandlerType {

public func openURL(_ url: URL) {
guard
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
else {
assertionFailure()
return
}

switch components.host {
case "response" where components.path == "":
handleGeneral()
default:
assertionFailure()
}
}
}

extension WeiboHandler: OpenUserActivityHandlerType {

public func openUserActivity(_ userActivity: NSUserActivity) {
Expand Down

0 comments on commit 4e0a5c6

Please sign in to comment.