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
extension UIImage { | |
class func imageByCombiningImage(firstImage: UIImage, withImage secondImage: UIImage) -> UIImage { | |
let newImageWidth = max(firstImage.size.width, secondImage.size.width ) | |
let newImageHeight = max(firstImage.size.height, secondImage.size.height) | |
let newImageSize = CGSize(width : newImageWidth, height: newImageHeight) | |
UIGraphicsBeginImageContextWithOptions(newImageSize, false, UIScreen.mainScreen().scale) |
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
// | |
// MakeTransparentHoleOnOverlayView.swift | |
// | |
// Created by James Laurenstin on 2015-04-10. | |
// Copyright (c) 2015 Aldo Group Inc. All rights reserved. | |
// | |
import UIKit | |
class MakeTransparentHoleOnOverlayView: UIView { |
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
// Blur Effect | |
var blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Dark) | |
var blurEffectView = UIVisualEffectView(effect: blurEffect) | |
blurEffectView.frame = view.bounds | |
view.addSubview(blurEffectView) | |
// Vibrancy Effect | |
var vibrancyEffect = UIVibrancyEffect(forBlurEffect: blurEffect) | |
var vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect) | |
vibrancyEffectView.frame = view.bounds |
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
import Foundation | |
public func profiling<R>(label: String, @noescape _ block: () -> R) -> R { | |
NSLog("*** %@...", label) | |
let start = NSDate() | |
defer { | |
let end = NSDate() | |
NSLog("*** %@ took %5.3g seconds", label, end.timeIntervalSinceDate(start)) | |
} | |
return block() |
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
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |