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 Foundation | |
import UIKit | |
import AVKit | |
import SwiftUI | |
import Combine | |
class PlayerUIView: UIView { | |
// MARK: Class Property | |
override static var layerClass: AnyClass { | |
return AVPlayerLayer.self |
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 Combine | |
import GoogleCast | |
struct GCKRequestPublisher: Publisher { | |
typealias Output = Void | |
typealias Failure = Error | |
let request: GCKRequest | |
init(request: GCKRequest) { |
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 BrightFutures | |
extension Resource { | |
func addLinkData<T: Resource>(resources: [T]) -> Future<Self, SpineError> { | |
let url = SpineSingleton.router.baseURL.appendingPathComponent("/\(self.resourceType)/\(self.id!)/relationships/\(resources.first!.resourceType)") | |
let payload = try! SpineSingleton.serializer.serializeLinkData(resources) | |
return performRequest(method: "POST", url: url, payload: payload) | |
} | |
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 MyOperation: Operation { | |
open func execute() { | |
let realm = try! Realm(configuration: Realm.Configuration(inMemoryIdentifier: "MyInMemoryRealm")) | |
// Do some stuff | |
networkClient.request(method: method, url: url, payload: payload) { statusCode, responseData, networkError in | |
// Now do some stuff on original operation threafd |
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
var skillIds: [String] | |
skillIds = selectedJobCategories.reduce([], { (results, jobCategory) -> [String] in | |
var results = results | |
results.append(contentsOf: jobCategory.skills!.linkage!.reduce([], { (results, resourceIdentifier) -> [String] in | |
var results = results | |
results.append(resourceIdentifier.id) | |
return results | |
})) | |
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
extension UIResponder { | |
func responder(for selector: Selector) -> UIResponder? { | |
if self.responds(to: selector) { | |
return self | |
} | |
if let next = self.next { | |
return next.responder(for: selector) | |
} |
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
NSDictionary * params = self.paramsBlock != nil ? self.paramsBlock((index < self.objects.count) ? index : self.objects.count-1) : nil; | |
if (params != nil) [mutableParams addEntriesFromDictionary:params]; |