##Xcode Locations
###Xcode Provisioning Profiles:
~/Library/MobileDevice/Provisioning\ Profiles
###Xcode Font and Color Schemes:
~/Library/Developer/Xcode/UserData/FontAndColorThemes
protocol Injectable: class { | |
var router: Routable { get } | |
} | |
class Injector: Injectable { | |
lazy var router: Routable { Router() }() | |
} | |
protocol Routable { | |
func route(url: String) |
##Xcode Locations
###Xcode Provisioning Profiles:
~/Library/MobileDevice/Provisioning\ Profiles
###Xcode Font and Color Schemes:
~/Library/Developer/Xcode/UserData/FontAndColorThemes
. |
protocol URLSessionDataTaskProtocol { | |
func resume() | |
} | |
extension NSURLSessionDataTask: URLSessionDataTaskProtocol { } |
import CoreLocation | |
struct AddressFormatter { | |
private let placemark: Placemarkable | |
init(placemark: Placemarkable) { | |
self.placemark = placemark | |
} | |
func formattedAddress() -> String { |
Apple quietly introduced a whole new suite of public API methods to NSCalendar
in iOS 8 titled “Calendrical Calculations”. For some reason they seemed to have forgotten to include them in the public documentation on their developer site. Fortunately, digging in to the header file in Xcode reveals lots of descriptive comments about how to use these powerful new ways of interacting with NSDate
objects.
import XCTest | |
class TestCase: XCTestCase { | |
let app = XCUIApplication() | |
override func setUp() { | |
super.setUp() | |
continueAfterFailure = false | |
app.launchArguments = ["UI-Testing"] |
//: Playground - noun: a place where people can play | |
struct Option { | |
var id: UInt | |
var name: String | |
} | |
func combine(options: [Option]) -> [UInt: String] { | |
var combinedOptions = [UInt: String]() | |
for option in options { |
//: Playground - noun: a place where people can play | |
enum Error: ErrorType { | |
case ParsingError | |
} | |
struct Person { | |
let name: String | |
let age: Int |