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
//Reference: https://stackoverflow.com/questions/53906275/rsa-public-key-created-in-ios-swift-and-exported-as-base64-not-recognized-in-jav | |
import SwiftyRSA | |
class RSAKeyEncoding: NSObject { | |
// ASN.1 identifiers | |
private let kASNBitStringIdentifier: UInt8 = 0x03 | |
private let kASNSequenceIdentifier: UInt8 = 0x30 | |
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 | |
enum QRScannerError: Error { | |
case deviceNotSupported | |
case permissionError(Error?) | |
case noQrFound | |
} | |
/// Delegate callback for the QRScannerView. | |
protocol QRScannerViewDelegate: class { |
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 | |
extension String { | |
func qrCode() -> UIImage? { | |
let data = self.data(using: .isoLatin1) | |
guard let qrFilter = CIFilter(name: "CIQRCodeGenerator") else { | |
return nil | |
} | |
qrFilter.setValue("M", forKey: "inputCorrectionLevel") |
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 | |
protocol Decorating { | |
var borderWidth: CGFloat {get set} | |
var cornerRadius: CGFloat {get set} | |
var borderColor: UIColor {get set} | |
var shadowOffset: CGSize {get set} | |
} | |
extension Decorating where Self: UIView { |
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 Alamofire | |
private let kArrayElementKey = "arrayElementKey" | |
extension Array { | |
func asParameter() -> Parameters { | |
return [kArrayElementKey: self] | |
} | |
} |
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 Alamofire | |
public class AuthSessionManager { | |
static var sharedManager = AuthSessionManager() | |
public var sessionManager: SessionManager | |
private init() { | |
let serverTrustPolicy = ServerTrustPolicy.pinCertificates ( |
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
// Sources: https://stackoverflow.com/questions/53906275/rsa-public-key-created-in-ios-swift-and-exported-as-base64-not-recognized-in-jav | |
import Foundation | |
class RSAKeyEncoding: NSObject { | |
// ASN.1 identifiers | |
private let kASNBitStringIdentifier: UInt8 = 0x03 | |
private let kASNSequenceIdentifier: UInt8 = 0x30 | |