Add these lines to register for keyboard notifications.
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillShow:", name: UIKeyboardWillShowNotification, object: nil)
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { | |
// Override point for customization after application launch. | |
application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Sound | UIUserNotificationType.Alert | | |
UIUserNotificationType.Badge, categories: nil)) | |
return true | |
} | |
import UIKit | |
let GfycatPOSTURL = "https://gifaffe.s3.amazonaws.com/" | |
let GfycatPolicy = "eyAiZXhwaXJhdGlvbiI6ICIyMDIwLTEyLTAxVDEyOjAwOjAwLjAwMFoiLAogICAgICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICAgICAgeyJidWNrZXQiOiAiZ2lmYWZmZSJ9LAogICAgICAgICAgICBbInN0YXJ0cy13aXRoIiwgIiRrZXkiLCAiIl0sCiAgICAgICAgICAgIHsiYWNsIjogInByaXZhdGUifSwKCSAgICB7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6ICIyMDAifSwKICAgICAgICAgICAgWyJzdGFydHMtd2l0aCIsICIkQ29udGVudC1UeXBlIiwgIiJdLAogICAgICAgICAgICBbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwgMCwgNTI0Mjg4MDAwXQogICAgICAgICAgICBdCiAgICAgICAgICB9" | |
let GfycatAWSAccessKeyId = "AKIAIT4VU4B7G2LQYKZQ" | |
let GfycatSignature = "mk9t/U/wRN4/uU01mXfeTe2Kcoc=" | |
let GfycatTranscodeURL = "http://upload.gfycat.com/transcode/" | |
class GfycatHandler: NSObject { |
self.resultSearchController = ({ | |
let controller = UISearchController(searchResultsController: nil) | |
controller.searchResultsUpdater = self | |
controller.dimsBackgroundDuringPresentation = false | |
controller.hidesNavigationBarDuringPresentation = false | |
controller.searchBar.barStyle = .Black | |
controller.searchBar.sizeToFit() | |
self.tableView.tableHeaderView = controller.searchBar | |
import UIKit | |
class ViewController: UIViewController { | |
@IBOutlet weak var cardView: UIView! | |
var popTip = AMPopTip() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} |
class Dynamic<T> { | |
typealias Listener = T -> Void | |
var listener: Listener? | |
func bind(listener: Listener?) { | |
self.listener = listener | |
} | |
func bindAndFire(listener: Listener?) { | |
self.listener = listener |
// | |
// ActionTrampoline.swift | |
// Swift 3 | |
// | |
// Created by Jason Jobe on 3/17/16. | |
// Copyright © 2016 WildThink. All rights reserved. | |
// | |
// https://gist.githubusercontent.com/wildthink/677308084ab364044c76/raw/f713efca9ec6ca9b56c4405bd82ae33b1db98ec7/ActionTrampoline.swift | |
// | |
// Kudos (again) to Mike Ash! |
$("form :input").each(function(index, elem) { | |
var eId = $(elem).attr("id"); | |
var label = null; | |
if (eId && (label = $(elem).parents("form").find("label[for="+eId+"]")).length == 1) { | |
$(elem).attr("placeholder", $(label).html()); | |
$(label).remove(); | |
} | |
}); |
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" | |
# This script loops through the frameworks embedded in the application and | |
# removes unused architectures. | |
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK | |
do | |
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) | |
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" | |
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" |