This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { | |
//Getting the url. | |
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb, | |
let url = userActivity.webpageURL | |
else | |
{return false} | |
//TODO: present desired view and load the url. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"applinks": { | |
"apps": [], | |
"details": [{ | |
"appID": "9JA89QQLNQ.developer.apple.wwdc-Release", | |
"paths": [ | |
"/wwdc/schedule" | |
] | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// myWebBrowser | |
// | |
// Created by arabdevteam on 8/10/16. | |
// Copyright © 2016 arabdevteam. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func textFieldShouldReturn(_ textField: UITextField) -> Bool { | |
let url = URL(string: "http://\(textField.text!)") // assigning textField value to url & enable user to write url without the need to "http://" | |
let request = URLRequest(url: url!) // making a request based on textField input text | |
myWeb.loadRequest(request) // loading webView with the request | |
textField.text = url?.relativeString // updating TextField with url string | |
textField.resignFirstResponder() // keyboard dismissal upon clicking search key | |
return true // search key as a search button | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidLoad() { | |
super.viewDidLoad() | |
textField.delegate = self // UITextField Delegation | |
myWeb.delegate = self // webView Delegation | |
let url = URL(string: “https://twitter.com/arabdevteam”)! | |
let request = URLRequest(url: url) | |
myWeb.loadRequest(request) | |
textField.text = url.relativeString // updating TextField with url string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSAllowsArbitraryLoads</key> | |
<true/> | |
</dict> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// creating a function to enable our textField to load the webView with new requests and this function used specifically to use search key as a search button.. | |
func textFieldShouldReturn(_ textField: UITextField) -> Bool { | |
let url = URL(string: textField.text!) // assigning textField value to url | |
let request = URLRequest(url: url!) // making a request based on textField input text | |
myWeb.loadRequest(request) // loading webView with the request | |
textField.text = url?.relativeString // updating TextField with url string | |
textField.resignFirstResponder() // keyboard dismissal upon clicking search key | |
return true // search key as a search button | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let url = URL(string: "https://twitter.com/arabdevteam")! | |
let request = URLRequest(url: url) | |
myWeb.loadRequest(request) |