This file contains hidden or 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 | |
import UIKit | |
public protocol Reusable: class, NSObjectProtocol { | |
static var reusableIdentifier: String { get } | |
} | |
public extension Reusable { | |
public static var reusableIdentifier: String { return String(Self) } | |
} |
This file contains hidden or 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 NSURL { | |
var queryDictionary: [String: AnyObject]? { | |
return NSURLComponents(URL: self, resolvingAgainstBaseURL: false)? | |
.queryItems? | |
.reduce([:], combine: { (var result: [String: AnyObject], queryItem) -> [String: AnyObject] in | |
if queryItem.value?.containsString(",") ?? false { | |
let array = queryItem.value?.componentsSeparatedByString(",") | |
result[queryItem.name] = array | |
} |