Logo animation for Horizon.io
A Pen by Chris Gannon on CodePen.
| class AsynchronousOperation: Operation { | |
| @objc private enum OperationState: Int { | |
| case ready | |
| case executing | |
| case finished | |
| } | |
| private let stateQueue = DispatchQueue(label: Bundle.main.bundleIdentifier! + ".rw.state", attributes: .concurrent) | |
| private var _state: OperationState = .ready | |
| //MARK: – Renew token | |
| public extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Response { | |
| public func retryWithAuthIfNeeded() -> Single<ElementType> { | |
| return catchError { error -> PrimitiveSequence<SingleTrait, Response> in | |
| if let moyaError: MoyaError = error as? MoyaError, let response: Response = moyaError.response { | |
| if response.statusCode == 401 { | |
| let user: User = AccountService.getUser() |
Logo animation for Horizon.io
A Pen by Chris Gannon on CodePen.
| #import "CoreDataManager.h" | |
| #import <RestKit/RestKit.h> | |
| #import "IGDebug.h" | |
| @implementation CoreDataManager | |
| @synthesize managedObjectContext = _managedObjectContext; | |
| @synthesize managedObjectModel = _managedObjectModel; | |
| @synthesize persistentStoreCoordinator = _persistentStoreCoordinator; |
| "AngularJS", | |
| "AutoFileName", | |
| "Autoprefixer", | |
| "Color Highlighter", | |
| "HTML-CSS-JS Prettify", | |
| "HTML5", | |
| "HTMLAttributes", | |
| "Jade", | |
| "JsFormat", | |
| "JSHint Gutter", |