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
class Client { | |
var baseURL = "http://dev.whatever.com/" | |
func execute(request : Request, completionHandler: (Response<AnyObject, NSError>) -> Void){ | |
Alamofire.request(request.method, baseURL + request.path, parameters: request.parameters()) | |
.responseJSON { response in | |
completionHandler(response) | |
} | |
} | |
} |
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 Alamofire | |
protocol Request { | |
var path : String { get } | |
var method : Method { get } | |
func parameters() -> [String : AnyObject] | |
} | |
struct AuthRequest : Request { | |
let path = "auth" |
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
{"data":{"pricingTiers":[{"tierStem":"0","tierName":"Free","pricingInfo":[{"country":"United States","countryCode":"US","currencySymbol":"$","currencyCode":"USD","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"Canada","countryCode":"CA","currencySymbol":"$","currencyCode":"CAD","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"Mexico","countryCode":"MX","currencySymbol":"$","currencyCode":"MXN","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"Australia","countryCode":"AU","currencySymbol":"$","currencyCode":"AUD","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"New Zealand","countryCode":"NZ","currencySymbol":"$","currencyCode":"NZD","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"Japan","countryCode":"JP","currencySymbol":"¥","currencyCode":" |
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
enum UIStackViewAlignment : Int { | |
case Fill | |
case Leading | |
static var Top: UIStackViewAlignment { get { return .Leading} } | |
case FirstBaseline | |
case Center | |
case Trailing | |
static var Bottom: UIStackViewAlignment { get{ return .Trailing} } | |
case LastBaseline | |
} |
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
enum UIStackViewDistribution : Int { | |
case Fill | |
case FillEqually | |
case FillProportionally | |
case EqualSpacing | |
case EqualCentering | |
} |
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
// | |
// main.swift | |
// pggrep | |
// | |
// Created by Erica Sadun on 6/17/15. | |
// Copyright © 2015 Erica Sadun. All rights reserved. | |
// | |
import Foundation |
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
// | |
// main.swift | |
// pggrep | |
// | |
// Created by Erica Sadun on 6/17/15. | |
// Copyright © 2015 Erica Sadun. All rights reserved. | |
// | |
import Foundation |
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
// | |
// SNGUserPhotosController.m | |
// Singles-eHarmony | |
// | |
// Created by Jack Flintermann | |
// Copyright (c) 2012 eHarmony. All rights reserved. | |
// | |
// | |
// 77$Z8DD88O8ZZOZ7II77II?????+++++++====================+=++++++?????7?I77O$$777II | |
// $7$O8D8O88OZ$$77IIIII????++++++++=======================++++++??????II77$$$77III |
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
#!/bin/sh | |
PLIST_BUDDY=/usr/libexec/PlistBuddy | |
function add_compatibility() { | |
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \ | |
"$1/Contents/Info.plist" | |
} | |
function has_compatibility() { |
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
LAContext *myContext = [[LAContext alloc] init]; | |
NSError *authError = nil; | |
NSString *myLocalizedReasonString = @"Authenticate using your finger"; | |
if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) { | |
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics | |
localizedReason:myLocalizedReasonString | |
reply:^(BOOL success, NSError *error) { | |
if (success) { | |
NSLog(@"User is authenticated successfully"); | |
} else { |