Skip to content

Instantly share code, notes, and snippets.

@susieyy susieyy/FBAppPresentable.swift Secret
Created Jan 14, 2017

What would you like to do?
protocol FBAppPresentable {}
extension FBAppPresentable where Self: UIViewController {
func openFacebookUrl(url: NSURL) {
guard let userId = url.lastPathComponent where Global.fbInstalled else {
presentWebViewController(of: url); return
guard let encodedUrl = NSURL.encoded(of: "fb://profile/\(userId)") else {
presentWebViewController(of: url); return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.