A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
This file contains hidden or 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
| # coding: utf-8 | |
| from objc_util import * | |
| NSAKDeserializer = ObjCClass('NSAKDeserializer') | |
| NSAKDeserializerStream = ObjCClass('NSAKDeserializerStream') | |
| NSAKSerializer = ObjCClass('NSAKSerializer') | |
| NSAKSerializerStream = ObjCClass('NSAKSerializerStream') | |
| NSAbstractLayoutGuide = ObjCClass('NSAbstractLayoutGuide') | |
| NSAddressCheckingResult = ObjCClass('NSAddressCheckingResult') | |
| NSAffineTransform = ObjCClass('NSAffineTransform') |
This file contains hidden or 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 NSView { | |
| var snapshot: NSImage { | |
| guard let bitmapRep = bitmapImageRepForCachingDisplayInRect(bounds) else { return NSImage() } | |
| bitmapRep.size = bounds.size | |
| cacheDisplayInRect(bounds, toBitmapImageRep: bitmapRep) | |
| let image = NSImage(size: bounds.size) | |
| image.addRepresentation(bitmapRep) | |
| return image | |
| } | |
| } |
This file contains hidden or 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 | |
| import Security | |
| class Keychain { | |
| class func save(key: String, data: NSData) -> Bool { | |
| let query = [ | |
| kSecClass as String : kSecClassGenericPassword as String, | |
| kSecAttrAccount as String : key, | |
| kSecValueData as String : data ] |
This file contains hidden or 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
| // MARK: NSFetchedResultsControllerDelegate | |
| func controllerWillChangeContent(controller: NSFetchedResultsController) { | |
| self.tableView.beginUpdates() | |
| } | |
| func controller(controller: NSFetchedResultsController, | |
| didChangeObject anObject: AnyObject, | |
| atIndexPath indexPath: NSIndexPath?, | |
| forChangeType type: NSFetchedResultsChangeType, |
This file contains hidden or 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 | |
| let GlobalQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
| class EchoServer { | |
| // let localQueue = dispatch_queue_create("\(EchoServer.self)", |
This file contains hidden or 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
| operator infix ~> { associativity right } | |
| @infix func ~>(firstBlock: (() -> Void), secondBlock: (() -> Void)) -> (() -> Void) { | |
| return { | |
| dispatch_async(dispatch_get_global_queue(-32768, 0), { | |
| firstBlock() | |
| dispatch_async(dispatch_get_main_queue(), secondBlock) | |
| }) | |
| } | |
| } |
This file contains hidden or 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
| // Creates a UIColor from a Hex string. | |
| func colorWithHexString (hex:String) -> UIColor { | |
| var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString | |
| if (cString.hasPrefix("#")) { | |
| cString = cString.substringFromIndex(1) | |
| } | |
| if (countElements(cString) != 6) { | |
| return UIColor.grayColor() |
This file contains hidden or 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 randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5] | |
| func partition(v: Int[], left: Int, right: Int) -> Int { | |
| var i = left | |
| for j in (left + 1)..(right + 1) { | |
| if v[j] < v[left] { | |
| i += 1 | |
| (v[i], v[j]) = (v[j], v[i]) | |
| } | |
| } |
Please see the official TTR Repository version: https://github.com/ToontownRewritten/api-doc/blob/master/login.md