This file contains 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
/** | |
Some numbers can have strange behaviour going back to Double or Float | |
If rounding in Decimal it's best to keep it in Decimal until the point of display or transport in JSON | |
Read here: https://forums.swift.org/t/jsonencoder-encodable-floating-point-rounding-error/41390/6 | |
**/ | |
/* | |
A helper that assists in rounding a Double to a given number of decimal places | |
*/ |
This file contains 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 AVFoundation | |
import Core | |
import Permission | |
import RxCocoa | |
import RxOptional | |
import RxSwift | |
import Vision |
This file contains 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 AVFoundation | |
import RxCocoa | |
import RxSwift | |
protocol CameraManagerDelegate: AnyObject { | |
func didStartRecord() | |
func didCapturedImage(_ image: CapturedImage) | |
func videoCapture(didCaptureVideoFrame pixelBuffer: CVPixelBuffer) | |
} |
This file contains 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 CoreML | |
import Foundation | |
import UIKit | |
public class Lesion { | |
public static let inputWidth = 416 | |
public static let inputHeight = 416 | |
public static let maxBoundingBoxes = 4 | |
// Tweak these values to get more or fewer predictions. |
This file contains 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 | |
final class ColorSelectionControl: UIControl { | |
private var buttons = [UIButton]() | |
private let colors: [UIColor] | |
lazy var currentSelectedColor: UIColor = colors[0] | |
init(colors: [UIColor]) { |
This file contains 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 | |
@IBDesignable | |
open class GradientView: UIView { | |
@IBInspectable | |
public var startColor: UIColor = .white { | |
didSet { | |
gradientLayer.colors = [startColor.cgColor, endColor.cgColor] | |
setNeedsDisplay() | |
} |
This file contains 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 RxSwift | |
import RxCocoa | |
final class DropdownTextField: CustomTextField, UIPickerViewDataSource, UIPickerViewDelegate { | |
var onDoneClicked: BehaviorRelay<Void?> = BehaviorRelay(value: nil) | |
var source: [String] = [] |
This file contains 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
| |
typealias Param = [AnyHashable: Any]? | |
| |
/// We use `CordinatorActionFactory` in AppDelegate to process data | |
final class CordinatorActionFactory { | |
| |
/// make a CoordinatorAction from url scheme data gotten from `CordinatorActionFactory` | |
func make(from urlSchemeHost: String, parameters: [String: Any]) -> CoordinatorAction? { | |
var params = parameters | |
params["type"] = urlSchemeHost |
This file contains 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 { Injectable } from "@angular/core"; | |
import { Component } from "@angular/core"; | |
import { Http } from "@angular/http"; | |
import { facebookVariables } from "../../getFBSDK"; | |
import { Router } from "@angular/router"; | |
import { LocalStorage, JSONSchema } from "@ngx-pwa/local-storage"; | |
import { User } from "../models/User"; | |
import {GoogleAuthService} from "ng-gapi/lib/GoogleAuthService"; | |
import GoogleUser = gapi.auth2.GoogleUser; |
This file contains 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
func isValidEmailAddress(email: String) -> Bool { | |
var returnValue = true | |
let emailRegEx = "[A-Z0-9a-z.-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,3}" | |
do { | |
let regex = try NSRegularExpression(pattern: emailRegEx) | |
let nsString = email as NSString | |
let results = regex.matches(in: email, range: NSRange(location: 0, length: nsString.length)) | |
NewerOlder