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 CoreLocation | |
class LocationManager: NSObject, CLLocationManagerDelegate { | |
//MARK: Object to Access Location Services | |
private let locationManager = CLLocationManager() | |
//MARK: Set up the Location Manager Delegate | |
override init() { | |
super.init() |
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 Darwin | |
import Foundation | |
import UIKit | |
@objc | |
class CGSVGDocument: NSObject { } | |
var CGSVGDocumentRetain: (@convention(c) (CGSVGDocument?) -> Unmanaged<CGSVGDocument>?) = load("CGSVGDocumentRetain") | |
var CGSVGDocumentRelease: (@convention(c) (CGSVGDocument?) -> Void) = load("CGSVGDocumentRelease") | |
var CGSVGDocumentCreateFromData: (@convention(c) (CFData?, CFDictionary?) -> Unmanaged<CGSVGDocument>?) = load("CGSVGDocumentCreateFromData") |
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
final class PublicKeyPinner { | |
/// Stored public key hashes | |
private let hashes: [String] | |
public init(hashes: [String]) { | |
self.hashes = hashes | |
} | |
/// ASN1 header for our public key to re-create the subject public key info | |
private let rsa2048Asn1Header: [UInt8] = [ |
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 Bool { | |
init<T : IntegerType>(_ integer: T){ | |
self.init(integer != 0) | |
} | |
} | |
// Now you can do this | |
let x = Bool(5) // true | |
let y = Bool(-1) // true | |
let z = Bool(0) // 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 <CoreData/CoreData.h> | |
@interface NSManagedObject (Cloner) | |
- (NSManagedObject *)clone; | |
- (NSManagedObject *)cloneInContext:(NSManagedObjectContext *)differentContext; | |
@end |