The base URL for this API is https://lambdaanimalspotter.herokuapp.com/api
Endpoint: /users/signup
import Foundation | |
protocol NetworkLoader { | |
func loadData(using request: URLRequest, with completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) | |
} | |
extension URLSession: NetworkLoader { | |
/// Asyncronously load data using a URL Request | |
/// - Parameters: | |
/// - request: an unwrapped URLRequest |
import Foundation | |
import Combine | |
enum APIError: Error, LocalizedError { | |
case unknown, apiError(reason: String) | |
var errorDescription: String? { | |
switch self { | |
case .unknown: | |
return "Unknown error" |
extension String { | |
func getRawVersionString() -> String? { | |
return self.removePrefix("v") | |
.split(separator: "-") | |
.first?.toString() | |
} | |
// Modified from the DragonCherry extension - https://github.com/DragonCherry/VersionCompare | |
private func compare(toVersion targetVersion: String) -> ComparisonResult { | |
let versionDelimiter = "." |
The base URL for this API is https://lambdaanimalspotter.herokuapp.com/api
Endpoint: /users/signup
extension UIView { | |
@objc func exerciseAmbiguityInLayoutRepeatedly() { | |
if self.hasAmbiguousLayout { | |
Timer.scheduledTimer(timeInterval: 0.5, | |
target: self, | |
selector: #selector(UIView.exerciseAmbiguityInLayout), | |
userInfo: nil, | |
repeats: true) | |
} | |
} |
How To sysdiagnose on iOS:
[{ | |
"key": "P", | |
"action": "togglePreview:", | |
"modifiers": ["cmd", "ctrl"] | |
}, { | |
"key": "I", | |
"action": "toggleInfo:", | |
"modifiers": ["cmd", "shift"] | |
}, { | |
"key": "T", |
import UIKit | |
class OnboardingManager { | |
private let userDefaults: UserDefaults | |
init(userDefaults: UserDefaults = .standard) { | |
self.userDefaults = userDefaults | |
} | |
func presentOnboardingControllerIfNeeded(in viewController: UIViewController) { |
diskutil list | |
diskutil unmount /dev/disk0s6 | |
sudo mount -w -t msdos /dev/disk0s6 /Volumes/data |