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
<?xml version="1.0" encoding="UTF-8"?> | |
<Bucket | |
type = "2" | |
version = "2.0"> | |
<Breakpoints> | |
<!-- All Exceptions --> | |
<BreakpointProxy | |
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
<BreakpointContent |
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 | |
protocol StoryboardBacked:class { | |
static func newFromStoryboardWithName(name:String?, bundle:NSBundle?) -> Self | |
} | |
extension StoryboardBacked { | |
static func newFromStoryboardWithName(name:String?, bundle:NSBundle?) -> Self { | |
let realName = name ?? NSStringFromClass(self as AnyClass).componentsSeparatedByString(".").last! | |
let storyboard = UIStoryboard(name: realName, bundle: bundle) |
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 completion<Result>(onResult: @escaping (Result) -> Void, onError: @escaping (Error) -> Void) -> ((Result?, Error?) -> Void) { | |
return { (maybeResult, maybeError) in | |
if let result = maybeResult { | |
onResult(result) | |
} else if let error = maybeError { | |
onError(error) | |
} else { | |
onError(SplitError.NoResultFound) | |
} | |
} |