Skip to content

Instantly share code, notes, and snippets.

View fabnoe's full-sized avatar

fabnoe fabnoe

View GitHub Profile
import UIKit
@objc(InsetBlurModalSeque) class InsetBlurModalSeque: UIStoryboardSegue {
override func perform() {
let sourceViewController = self.sourceViewController as UIViewController
let destinationViewController = self.destinationViewController as UIViewController
// Make sure the background is ransparent
destinationViewController.view.backgroundColor = UIColor.clearColor()
@fabnoe
fabnoe / ReversedUIButton.swift
Last active August 29, 2015 14:05
Draws a button with the image on the right hand side of the label
import UIKit
class ReversedUIButton: UIButton {
var buffer:NSNumber = 5
override func layoutSubviews() {
super.layoutSubviews()
let imageSize:CGSize = self.imageView.frame.size
@fabnoe
fabnoe / InterfaceController.swift
Last active August 29, 2015 14:18
Extension to load an external image
//
// InterfaceController.swift
// AsnycCall WatchKit Extension
//
// Created by Fabian Nöthe on 05.04.15.
// Copyright (c) 2015. All rights reserved.
//
import WatchKit
func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: (([NSObject : AnyObject]!) -> Void)!) {
// Begin background task, recommended by apple so your app doesnt get terminated by the system for taking too long to complete the network task
var identifier : UIBackgroundTaskIdentifier!
identifier = UIApplication.sharedApplication().beginBackgroundTaskWithName("Hello", expirationHandler: { () -> Void in
UIApplication.sharedApplication().endBackgroundTask(identifier)
identifier = UIBackgroundTaskInvalid
})
class StartViewController : UIViewController {
private var contextQueue_:dispatch_queue_t? = nil
private var originalImage:UIImage?
@IBOutlet weak var imageView: UIImageView!
@IBAction func convert(sender: AnyObject) {
applyFilter()
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Landing Page</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">