View Obfuscator.swift
//
// Obfuscator.swift
// SwiftObfuscatorExample
//
// Created by Mathieu White on 2016-07-03.
// Copyright © 2016 Mathieu White. All rights reserved.
//
import Foundation
View gist:3cfc8289c30472f40d2f7d02ef72ddcb
import UIKit
struct ConstraintInfo {
var attribute: NSLayoutAttribute = .left
var secondAttribute: NSLayoutAttribute = .notAnAttribute
var constant: CGFloat = 0
var identifier: String?
var relation: NSLayoutRelation = .equal
}
View ViewController.swift
import UIKit
class ViewController: UIViewController, UIWebViewDelegate {
@IBOutlet weak var webView: UIWebView!
let html = "<div> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet porttitor urna. Curabitur ut mattis magna. Fusce cursus diam ac sapien faucibus, at consectetur tellus laoreet. Integer faucibus risus in tempus bibendum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum mauris vel augue mollis rutrum. Nam lectus libero, blandit eget lorem vitae, consectetur pharetra nibh. Donec ornare vulputate justo, id viverra eros scelerisque eget. Nam eleifend blandit nisi, nec sodales dui sagittis quis.</p><ul><li><a href='http://cnn.com'>CNN</a></li><li><a href='https://apple.com'>Apple</a></li><li><a href='https://google.com'>Google</a></li></ul><p>Donec eget finibus tortor. Nulla et tempor enim. Maecenas at libero gravida, malesuada orci nec, posuere quam. Sed placerat auctor nunc, non consequat erat molestie eu. Sed aliquet u
View webviewextension.swift
import UIKit
extension UIWebView {
func hideOverscrollShadow(hide: Bool) {
for subView: UIView in self.subviews {
if subView.isKindOfClass(UIImageView) {
subView.removeFromSuperview()
}
View ViewController.swift
import UIKit
class ViewController: UIViewController, UIWebViewDelegate {
@IBOutlet weak var webView: UIWebView!
let html = "<div> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet porttitor urna. Curabitur ut mattis magna. Fusce cursus diam ac sapien faucibus, at consectetur tellus laoreet. Integer faucibus risus in tempus bibendum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum mauris vel augue mollis rutrum. Nam lectus libero, blandit eget lorem vitae, consectetur pharetra nibh. Donec ornare vulputate justo, id viverra eros scelerisque eget. Nam eleifend blandit nisi, nec sodales dui sagittis quis.</p><p>Donec eget finibus tortor. Nulla et tempor enim. Maecenas at libero gravida, malesuada orci nec, posuere quam. Sed placerat auctor nunc, non consequat erat molestie eu. Sed aliquet ullamcorper risus at efficitur. Nulla facilisi. In blandit leo quis eros vulputate efficitur. In non nibh mattis, malesuada nulla nec, mol
View BaseController.swift
import UIKit
class BaseViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let backTitle = NSLocalizedString("Back", comment: "Back button label")
self.addBackbutton(backTitle)
View BaseController.swift
import UIKit
class BaseViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
Analytics().screenView(self.controllerName)
}
}
View ParameterEncodingExt.swift
// Actual gzipping from https://github.com/1024jp/NSData-GZIP
// Example: ParameterEncoding.JSON.gzipped
infix operator • { associativity left }
func<A, B, C>(f: B -> C, g: A -> B) -> A -> C {
return { x in f(g(x)) }
}
extension ParameterEncoding {
View appt.tss
//In your app/styles directory you will find an app.tss file
//If this file doesn't exist, simply add it to your project.
//The app.tss is used to apply styles across your project.
//For more on how this works, please visit http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Styles_and_Themes-section-35621526_AlloyStylesandThemes-GlobalStyles
//In your app.tss add the below Window style. This will set the orientation
//for all windows in your app
"Window" : {
orientationModes :[
Ti.UI.PORTRAIT
View NSTimeZoneIANA.playground
//: NSTimeZone and the IANA db
import UIKit
//http://www.iana.org/time-zones
let IANAtimeZones = ["GMT","Europe/Andorra","Asia/Dubai","Asia/Kabul","America/Antigua","America/Anguilla","Europe/Tirane","Asia/Yerevan","Africa/Luanda","Antarctica/McMurdo","Antarctica/Rothera","Antarctica/Palmer","Antarctica/Mawson","Antarctica/Davis","Antarctica/Casey","Antarctica/Vostok","Antarctica/DumontDUrville","Antarctica/Syowa","Antarctica/Troll","America/Argentina/Buenos_Aires","America/Argentina/Cordoba","America/Argentina/Salta","America/Argentina/Jujuy","America/Argentina/Tucuman","America/Argentina/Catamarca","America/Argentina/La_Rioja","America/Argentina/San_Juan","America/Argentina/Mendoza","America/Argentina/San_Luis","America/Argentina/Rio_Gallegos","America/Argentina/Ushuaia","Pacific/Pago_Pago","Europe/Vienna","Australia/Lord_Howe","Antarctica/Macquarie","Australia/Hobart","Australia/Currie","Australia/Melbourne","Australia/Sydney","Australia/Broken_Hill","Australia/Brisbane","Australia/Lindeman","Australia/A