Skip to content

Instantly share code, notes, and snippets.

View arabdevteam's full-sized avatar

 فريق المطورين العرب arabdevteam

View GitHub Profile
<head>
<meta name="apple-itunes-app" content="app-id=640199958">
</head>
{
"applinks": {
"apps": [],
"details": [{
"appID": "9JA89QQLNQ.developer.apple.wwdc-Release",
"paths": [
"/wwdc/schedule"
]
}]
}
@arabdevteam
arabdevteam / Website.swift
Created November 29, 2017 07:24
Simple website in swift
//
// ViewController.swift
// myWebBrowser
//
// Created by arabdevteam on 8/10/16.
// Copyright © 2016 arabdevteam. All rights reserved.
//
import UIKit
@arabdevteam
arabdevteam / http.swift
Last active January 9, 2018 23:35
How to type url directly in UITextField without "http://".
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
}
@arabdevteam
arabdevteam / urlString.swift
Created November 29, 2017 07:20
Adding Url.relative string to UITextField.
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
}
@arabdevteam
arabdevteam / ATS.XML
Created November 29, 2017 07:16
How to get rid off Apple Transport Security for testing purposes.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
// 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
}
let url = URL(string: "https://twitter.com/arabdevteam")!
let request = URLRequest(url: url)
myWeb.loadRequest(request)