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 | |
enum ServiceId { | |
case service(id: String) | |
func id() -> String { | |
switch self { | |
case .service(let id): return id | |
} | |
} | |
} |
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 | |
class Service { | |
typealias ServiceId = String | |
let id: ServiceId | |
init(id: ServiceId) { | |
self.id = id | |
} | |
} |
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 dnssd | |
struct DNSTxtRecord { | |
typealias DNSLookupHandler = ([String: String]?) -> Void | |
static func lookup(_ domainName: String, completionHandler: @escaping DNSLookupHandler) { | |
var mutableCompletionHandler = completionHandler // completionHandler needs to be mutable to be used as inout param | |
let callback: DNSServiceQueryRecordReply = { | |
(sdRef, flags, interfaceIndex, errorCode, fullname, rrtype, rrclass, rdlen, rdata, ttl, context) -> Void in |
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
struct API { | |
typealias Result = () throws -> JSON | |
enum Error: ErrorType { | |
case ConnectionError(NSError?) | |
case ServerError(statusCode: Int, message: String?) | |
case JSONError(NSError?) | |
} | |
} |
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
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
GlobalAppearance.setup() | |
NewRelic.enableFeatures([NRMAFeatureFlags.NRFeatureFlag_NSURLSessionInstrumentation, NRMAFeatureFlags.NRFeatureFlag_HttpResponseBodyCapture]) | |
NewRelic.startWithApplicationToken("AA0c7adbf8d4ae29c081f35bd0764243d19a44b5fb"); | |
NewRelic.setMaxEventBufferTime(1) | |
NRLogger.setLogLevels(0xffff) | |
... | |
} |