Skip to content

Instantly share code, notes, and snippets.

View thecoolwinter's full-sized avatar

Khan Winter thecoolwinter

View GitHub Profile
@thecoolwinter
thecoolwinter / PercentageField.swift
Last active February 10, 2022 18:28
UITextField that automatically formats a percentage as a user types. It limits the input, and can return a value without any string formatting.
//
// PercentageField.swift
//
// Created by Khan Winter on 8/16/20.
//
import UIKit
class PercentageField: UITextField {
import Foundation
public class CodableStorage {
fileprivate init() { }
enum Directory {
case documents
case caches
case shared // Use for sharing files between containers. Eg, with an app extension.