This is the most common way to get the path to the selected instance:
xcrun xcode-select --print-path| import Foundation | |
| enum AppDefault { | |
| case APIServer, runMode, homeDirectory, reactHost | |
| var stringValue: String? { | |
| get { | |
| return NSUserDefaults.standardUserDefaults().stringForKey(String(self)) | |
| } | |
SSH (Secure Shell) to a host existing in an internal network through a reverse-tunneled SSH connection to an externally accessible VPS (Virtual Private Server). This setup is described where the internal host is a Raspberry Pi, but can be generalized for any host on the internal network that runs an OpenSSH server.
internal network Internet home network
|| ||
------------------ || ------------------ || ------------------
| | reverse SSH tunnel (VPS $tunnel_port to Pi port 22) | | || | |
| Raspberry Pi ==================================================> VPS ===================
| 1. Open Terminal | |
| 2. cd to your Xcode project | |
| 3. Execute the following when inside your target project: | |
| find . -name "*.swift" -print0 | xargs -0 wc -l |
| import PlaygroundSupport | |
| import Foundation | |
| import Combine | |
| // MARK: - Network Controller | |
| protocol NetworkControllerProtocol: class { | |
| typealias Headers = [String: Any] | |
| func get<T>(type: T.Type, | |
| url: URL, |
| # A Best in Class Checklist | |
| A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10. | |
| > To use this, create a Github Issue in your own repo, and simply copy and paste this text. | |
| ## iOS Core Technology | |
| _Things any iOS app can benefit from_ | |
| - [ ] iCloud Sync | |
| - [ ] [Core Spotlight integration](https://github.com/DreamingInBinary/Spend-Stack/issues/120) |
| import PlaygroundSupport | |
| import Foundation | |
| class WeakRef<T> where T: AnyObject { | |
| private(set) weak var value: T? | |
| init(value: T?) { | |
| self.value = value | |
| } |
| // | |
| // ObservableEventTransforms.swift | |
| // | |
| // Created by Daniel Tartaglia on 9/22/18. | |
| // Copyright © 2019 Daniel Tartaglia. MIT License. | |
| // | |
| import RxSwift | |
| /** |
A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.
Both UITableView and UICollectionView offer a similar API to register custom cell classes:
public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)