Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View joaoduartemariucio's full-sized avatar

João Vitor Duarte Mariucio joaoduartemariucio

View GitHub Profile
@joaoduartemariucio
joaoduartemariucio / Decodable+Enum.swift
Last active October 1, 2021 20:21
Decodable with enum inside response
import Foundation
struct Response: Decodable {
let name: String
let note: String
let status: Status
}
enum Status: String, Decodable {
case observation = "OBSERVATION"
@joaoduartemariucio
joaoduartemariucio / String+ASCII.swift
Last active September 29, 2021 18:57
String to Decimal ASCII value
import Foundation
// Converting a letter to decimal
// Manual form
let lowercaseA: UInt8? = Character("a").asciiValue
print("decimal ascii: \(lowercaseA)")
// OUTPUT
// decimal ascii: 97
// Swift 3
extension UIButton {
func pulsate() {
let pulse = CASpringAnimation(keyPath: "transform.scale")
pulse.duration = 0.6
pulse.fromValue = 0.95
pulse.toValue = 1.0