I have a WebView app in my iPhone but I want when I click in share button in google+ and Facebook I would like to open it in Facebook app *when installed,when not in safari )but another links to open all in web view just from Facebook and google+ \ import UIKit
class ViewController: UIViewController {
@IBOutlet weak var webView: UIWebView!
static let LOAD_FROM_URL = true
override func viewDidLoad() {
super.viewDidLoad()
if ViewController.LOAD_FROM_URL {
// URLからロードする
if let requestURL = NSURL(string: "http://google.com/") { // TODO: URLを指定する
let req = NSURLRequest(URL: requestURL)
self.webView.loadRequest(req)
}
}
}
func WebView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {
// [SDK] 広告クリックの時の処理を行う
if !WebView(webView, shouldStartLoadWithRequest: request, navigationType: navigationType) {
return false;
}
return true;
}
}