For faster connection speed and more flexibility.
- Start Xcode in command line by running this in commandline
/Applications/Xcode.app/Contents/MacOS/Xcode - Start downloading of the simulator
- Cancel it. YES CANCEL IT!
- You will get a message like this:
| public struct Units { | |
| public let bytes: Int64 | |
| public var kilobytes: Double { | |
| return Double(bytes) / 1_024 | |
| } | |
| public var megabytes: Double { | |
| return kilobytes / 1_024 |
| import Foundation | |
| import SceneKit | |
| public enum BinarySTLParser { | |
| public enum STLError: Error { | |
| case fileTooSmall(size: Int) | |
| case unexpectedFileSize(expected: Int, actual: Int) | |
| case triangleCountMismatch(diff: Int) | |
| } | |
| // No Security | |
| { | |
| "rules": { | |
| ".read": true, | |
| ".write": true | |
| } | |
| } |
| //: Playground - noun: a place where people can play | |
| // | |
| // The result is not guaranteed to be accurate. Typically, the function requires 200-400 characters to reliably guess the language of a string. | |
| // Reference: [CFStringTokenizerCopyBestStringLanguage(_:_:)](https://developer.apple.com/reference/corefoundation/1542136-cfstringtokenizercopybeststringl) | |
| // | |
| import Foundation | |
| extension String { | |
| func guessLanguage() -> String { |
| /* | |
| Joseph Weizenbaum's classic ELIZA chat bot in Swift. | |
| Based on the IBM PC BASIC program from CREATIVE COMPUTING by Patricia | |
| Danielson and Paul Hashfield, and the Java adaptation by Jesper Juul. | |
| Run this script from Terminal: | |
| $ swift eliza.swift | |
| Press Ctrl-C or Ctrl-D to quit. (Or type "shut up".) |
| // Since we are unable to extend ObjC protocols in swift, we wrap this around a custom NSObject subclass | |
| // that deals exclusive with handling the image picker delegate methods and chaining the response down to | |
| // the MediaPickerPresenter conforming delegate | |
| class ImagePickerHandler: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate { | |
| var delegate: MediaPickerPresenter? | |
| let sourceType: UIImagePickerControllerSourceType | |
| let picker = UIImagePickerController() | |
For faster connection speed and more flexibility.
/Applications/Xcode.app/Contents/MacOS/Xcode