This file contains hidden or 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
extension SymmetricKey { | |
init(string keyString: String, size: SymmetricKeySize = .bits256) throws { | |
guard var keyData = keyString.data(using: .utf8) else { | |
print("Could not create base64 encoded Data from String.") | |
throw CryptoKitError.incorrectParameterSize | |
} | |
let keySizeBytes = size.bitCount / 8 | |
keyData = keyData.subdata(in: 0..<keySizeBytes) | |
This file contains hidden or 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
fileprivate let badChars = CharacterSet.alphanumerics.inverted | |
extension String { | |
var uppercasingFirst: String { | |
return prefix(1).uppercased() + dropFirst() | |
} | |
var lowercasingFirst: String { | |
return prefix(1).lowercased() + dropFirst() | |
} |
This file contains hidden or 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
i386 : iPhone Simulator | |
x86_64 : iPhone Simulator | |
arm64 : iPhone Simulator | |
iPhone1,1 : iPhone | |
iPhone1,2 : iPhone 3G | |
iPhone2,1 : iPhone 3GS | |
iPhone3,1 : iPhone 4 | |
iPhone3,2 : iPhone 4 GSM Rev A | |
iPhone3,3 : iPhone 4 CDMA | |
iPhone4,1 : iPhone 4S |
This file contains hidden or 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
// | |
// FormDemoApp.swift | |
// FormDemo | |
// | |
// Created by Marc Prud'hommeaux | |
// | |
import SwiftUI | |
@main |
This file contains hidden or 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
// NSRegularExpression+Split.swift | |
// | |
// Verbatim ObjC->Swift port originating from https://github.com/bendytree/Objective-C-RegEx-Categories | |
extension NSRegularExpression { | |
func split(_ str: String) -> [String] { | |
let range = NSRange(location: 0, length: str.characters.count) | |
//get locations of matches |