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: - Swizzling | |
extension UIFont { | |
class var defaultFontFamily: String { return "Georgia" } | |
override public class func initialize() | |
{ | |
if self == UIFont.self { | |
swizzleSystemFont() | |
} | |
} |
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
// Based on Swift 1.2, ObjectMapper 0.15, RealmSwift 0.94.1 | |
// Author: Timo Wälisch <[email protected]> | |
import UIKit | |
import RealmSwift | |
import ObjectMapper | |
import SwiftyJSON | |
class ArrayTransform<T:RealmSwift.Object where T:Mappable> : TransformType { | |
typealias Object = List<T> |
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
//: # Swift 3: URLSessionDelegate | |
//: The following example shows how to use `OperationQueue` to queue the network requests. This is useful in many ways (for delaying queued requests when the networking goes down for example) | |
import Foundation | |
import PlaygroundSupport | |
class Requester:NSObject { | |
let opQueue = OperationQueue() | |
var response:URLResponse? |
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 | |
import PlaygroundSupport | |
/// A thread-safe array. | |
public class SynchronizedArray<Element> { | |
private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent) | |
private var array = [Element]() | |
public init() { } | |