mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-16 00:06:11 +10:00
URL.yep_matchProfile
This commit is contained in:
@@ -312,17 +312,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
private func handleUniversalLink(URL: NSURL) -> Bool {
|
||||
|
||||
let matchSharedFeed = URL.yep_matchSharedFeed({ feed in
|
||||
return URL.yep_matchSharedFeed({ feed in
|
||||
|
||||
println("matchSharedFeed: \(feed)")
|
||||
|
||||
}) || URL.yep_matchProfile({
|
||||
|
||||
println("matchProfile")
|
||||
})
|
||||
|
||||
if !matchSharedFeed {
|
||||
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
/*
|
||||
guard let host = URL.host else {
|
||||
return false
|
||||
|
||||
@@ -51,5 +51,27 @@ extension NSURL {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// make sure put it in last
|
||||
|
||||
func yep_matchProfile(completion: () -> Void) -> Bool {
|
||||
|
||||
guard let host = host where host == yepHost else {
|
||||
return false
|
||||
}
|
||||
|
||||
guard let pathComponents = pathComponents else {
|
||||
return false
|
||||
}
|
||||
|
||||
if let username = safeFindElement(pathComponents, index: 1) {
|
||||
|
||||
completion()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user