Skip to content

Instantly share code, notes, and snippets.

@mikeMTOL
mikeMTOL / UIColor+String.swift
Last active August 29, 2015 14:04
UIColor extension and String substring extension
//
// Color+Utils.swift
// taskmanager
//
// Created by Mike on 2014-07-30.
// Copyright (c) 2014 Mike. All rights reserved.
//
import UIKit
@mikeMTOL
mikeMTOL / UICollectionViewController+NSFetchedResultsController.swift
Last active April 14, 2016 08:06
This makes any UICollectionViewController able to handle an NSFetchedResultsController
extension UICollectionViewController: NSFetchedResultsControllerDelegate {
private struct AssociatedKeys {
static var operationsArray = "operationsArrayKey"
}
var fetchedResultsProcessingOperations: [NSBlockOperation]? {
get {
return objc_getAssociatedObject(self, &AssociatedKeys.operationsArray) as? [NSBlockOperation]
@IBDesignable
class UIPaddedLabel:UILabel {
@IBInspectable var topPadding:CGFloat = 0 {
didSet {
updatePadding()
}
}
@IBInspectable var leftPadding:CGFloat = 0 {
didSet {