I hereby claim:
- I am brettohland on github.
- I am bretto (https://keybase.io/bretto) on keybase.
- I have a public key whose fingerprint is 424B 5733 C07A DD48 3D7B 8147 1F6B 0BDD 87F4 51F2
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#! /usr/bin/env ruby | |
require 'fileutils' | |
require 'pathname' | |
#Remove the \n character at the end of the path returned | |
root = %x(git rev-parse --show-toplevel).chomp | |
root_path = Pathname.new(root) | |
podfile = root + '/Podfile.lock' |
import SwiftUI | |
import UIKit | |
// MARK: - Setup | |
let twosdayDateComponents = DateComponents( | |
year: 2022, | |
month: 2, | |
day: 22, | |
hour: 2, |
struct ToYen: FormatStyle { | |
typealias FormatInput = Int | |
typealias FormatOutput = String | |
func format(_ value: Int) -> String { | |
Decimal(value * 100).formatted(.currency(code: "jpy")) | |
} | |
} | |
extension FormatStyle where Self == ToYen { |
A collection of all of the various options and styles available to you if you'd like to format data into string on iOS 15.
See every option in detail at fuckingformatstyle.com or goshdarnformatstyle.com.
import Foundation | |
// MARK: - URL | |
// https://developer.apple.com/documentation/foundation/formatstyle/4013379-url | |
let appleURL = URL(string: "https://apple.com")! | |
appleURL.formatted() // "https://apple.com" | |
appleURL.formatted(.url) // "https://apple.com" | |
appleURL.formatted(.url.locale(Locale(identifier: "fr_FR"))) // "https://apple.com" |
A full example of adding String
and AttributedString
output to our custom types, as well as adding the ability to parse String
values into your custom type.