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
// | |
// NSAttributedString+HTMLStyle.h | |
// QRContentMobilizer | |
// | |
// Created by Wojciech Czekalski on 22.03.2014. | |
// Copyright (c) 2014 Wojciech Czekalski. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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 | |
extension NSDate { | |
class func dateFromISO8601String(string: String?) -> NSDate? { | |
guard let string = string else { | |
return nil | |
} | |
var tm = Darwin.tm() |
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 Optional: BooleanType { | |
public var boolValue: Bool { | |
switch self { | |
case .Some(let value) where !(value is Bool): | |
return true | |
case .Some(let value as Bool) where value: | |
return true | |
default: | |
return false |
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 UIKit | |
extension UIResponder { | |
private weak static var _currentFirstResponder: UIResponder? | |
static var currentFirstResponder: UIResponder? { | |
get { | |
_currentFirstResponder = nil | |
UIApplication.sharedApplication().sendAction(#selector(findFirstResponder), to: nil, from: nil, forEvent: nil) |
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 NSUUID { | |
static var zero: NSUUID { | |
var bytes = [UInt8](count: 16, repeatedValue: 0) | |
return NSUUID(UUIDBytes: &bytes) | |
} | |
} |
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
Pod::Spec.new do |s| | |
s.name = 'BLEFramework' | |
s.version = '1.4' | |
s.summary = 'The Buzz Flashing Glassware framework allows you to activate your Buzz Celebration Drinkware from your mobile device.' | |
s.homepage = 'http://www.buzzproducts.com/flashingcup/' | |
s.author = { 'Buzz Products' => '[email protected]' } | |
s.source = { :path => 'BLEFramework' } | |
s.social_media_url = 'https://twitter.com/buzzproducts' | |
s.ios.deployment_target = '8.0' |
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 | |
#if swift(>=3.0) | |
typealias HashTable<ObjectType: AnyObject> = NSHashTable<ObjectType> | |
#else | |
struct HashTable<ObjectType: AnyObject> { | |
private let _table = NSHashTable.weakObjectsHashTable() | |
static func weakObjects() -> HashTable<ObjectType> { |
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
// MARK: RawRepresentable Equality | |
func ==<T: Equatable, U: protocol<RawRepresentable, Equatable> where U.RawValue == T>(left: T?, right: U?) -> Bool { | |
return left == right?.rawValue | |
} | |
func !=<T: Equatable, U: protocol<RawRepresentable, Equatable> where U.RawValue == T>(left: T?, right: U?) -> Bool { | |
return left != right?.rawValue | |
} |
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
private extension UIView { | |
private struct Static { | |
static let initialize: (AnyClass) -> Void = { (aClass: AnyClass!) in | |
let swizzle: (Selector, Selector) -> Void = { (original, swizzled) in | |
let originalSelector = original | |
let swizzledSelector = swizzled | |
let originalMethod = class_getInstanceMethod(aClass, originalSelector) | |
let swizzledMethod = class_getInstanceMethod(aClass, swizzledSelector) |