diff --git a/Yep/AppDelegate.swift b/Yep/AppDelegate.swift index 636f5edf..22a1380e 100644 --- a/Yep/AppDelegate.swift +++ b/Yep/AppDelegate.swift @@ -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 diff --git a/Yep/Extensions/NSURL+Yep.swift b/Yep/Extensions/NSURL+Yep.swift index 0e37c769..2b870f08 100644 --- a/Yep/Extensions/NSURL+Yep.swift +++ b/Yep/Extensions/NSURL+Yep.swift @@ -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 + } }