Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| // ------------------------------------- | |
| // Swift Integer Quick Guide | |
| // ------------------------------------- | |
| // Created by Keith Harrison http://useyourloaf.com | |
| // Copyright (c) 2017 Keith Harrison. All rights reserved. | |
| // | |
| // Redistribution and use in source and binary forms, with or without | |
| // modification, are permitted provided that the following conditions are met: | |
| // |
| import Foundation | |
| protocol Initable { | |
| init() | |
| } | |
| extension String: Initable {} | |
| extension Double: Initable {} | |
| protocol AnyValueSettable { |
| import Cocoa | |
| import Foundation | |
| var str = "Hello, playground" | |
| var task:NSTask = NSTask() | |
| var pipe:NSPipe = NSPipe() | |
| task.launchPath = "/bin/ls" | |
| task.arguments = ["-la"] |
| import Foundation | |
| private class ValueTransformer: NSValueTransformer { | |
| let transform: (AnyObject?) -> (AnyObject?) | |
| init(transform: (AnyObject?) -> (AnyObject?)) { | |
| self.transform = transform | |
| } | |
| // MARK: NSValueTransformer |
| // Numerical matrix examples | |
| let x: Matrix = [[10, 9, 8], [3, 2, 1]] | |
| let y: Matrix = [[1, 2, 3], [4, 5, 6]] | |
| let z: Matrix = [[1, 2], [3, 4], [5, 6]] | |
| x + y // [[11, 11, 11], [7, 7, 7]] | |
| x * y // [[10, 18, 24], [12, 10, 6]] | |
| 2 * x // [[20, 18, 16], [6, 4, 2]] | |
| y ** z // [[22, 28], [49, 64]] |
| // Use an integer literal to instantiate | |
| let a: BigInt = 23559821412349283 | |
| // Or use a string literal if you want to start with a number that is greater than IntMax | |
| let b: BigInt = "123456789876543234567876543234567876543" | |
| // Perform arithmetic operations | |
| let c: BigInt = 123456 + 321 // -> 12777 | |
| let d = c / 100 // -> 127 | |
| let e = d << d // -> 12700000000......(127 zeros) |
| ACTION | |
| AD_HOC_CODE_SIGNING_ALLOWED | |
| ALTERNATE_GROUP | |
| ALTERNATE_MODE | |
| ALTERNATE_OWNER | |
| ALWAYS_SEARCH_USER_PATHS | |
| ALWAYS_USE_SEPARATE_HEADERMAPS | |
| APPLE_INTERNAL_DEVELOPER_DIR | |
| APPLE_INTERNAL_DIR | |
| APPLE_INTERNAL_DOCUMENTATION_DIR |
| // | |
| // PRHAngleGradientFilter.h | |
| // | |
| // Created by Peter Hosey on 2013-01-30. | |
| // Copyright (c) 2013 Peter Hosey. All rights reserved. | |
| // | |
| #import <QuartzCore/QuartzCore.h> | |
| @interface PRHAngleGradientFilter : CIFilter |
Is AppKit causing you frustration? Instead of just complaining about it, lets try to make it better by compiling a list of specific problems with AppKit. Leave a comment below, and I'll include it in the list.
##NSView##
NSView does not have the ability to set an affine transform (rdar://15608609)NSTextField) do not respond properly when layer-backed. Take NSButton as an example. When not layer-backed, it will animate properly using the animator proxy. When layer-backed, using the animator proxy breaks focus rings (they jump to destination immediately). Currently, directly manipulating the layer of a cell-based control is not supported (and will lead to a broken interface), but is much needed. (rdar://15608822)##NSViewController##
NSViewController could be more useful. It has -loadView but no other lifecycle methods. (rdar://15608948)