Skip to content

Instantly share code, notes, and snippets.

View BlueMilkApps's full-sized avatar

Blue Milk Apps BlueMilkApps

View GitHub Profile
import UIKit
@IBDesignable
class SomeLiveClass: UIView {
@IBInspectable var placeholder: String = "Default"
@IBInspectable var fontSize: CGFloat = 20
@IBInspectable var lineWidth: CGFloat = 1
@IBInspectable var lineColor: UIColor = UIColor.blackColor()
@BlueMilkApps
BlueMilkApps / TotemPaintCodeKit.swift
Created December 12, 2014 00:21
PaintCode UIButton Image Example
import UIKit
public class TotemPaintCodeKit : NSObject {
//// Cache
private struct Cache {
static var imageOfSmileFace: UIImage?
static var smileFaceTargets: [AnyObject]?
}
import UIKit
enum Direction { case In, Out }
protocol Dimmable { }
extension Dimmable where Self: UIViewController {
func dim(direction: Direction, color: UIColor = UIColor.blackColor(), alpha: CGFloat = 0.0, speed: Double = 0.0) {
import UIKit
class PrimaryViewController: UIViewController, Dimmable {
let dimLevel: CGFloat = 0.5
let dimSpeed: Double = 0.5
override func viewDidLoad() { super.viewDidLoad() }
override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() }
import UIKit
class SecondaryViewController: UIViewController {
@IBOutlet weak var popupView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
popupView.layer.cornerRadius = 10
popupView.layer.borderColor = UIColor.blackColor().CGColor
popupView.layer.borderWidth = 0.25