Skip to content

Instantly share code, notes, and snippets.

View cscouto's full-sized avatar
🎯
Focusing

Tiago Do Couto cscouto

🎯
Focusing
View GitHub Profile
@cscouto
cscouto / UIView+Shadow.swift
Created July 24, 2018 21:36
SWIFT - Add Shadows to UIView
//
// UIView+Shadows.swift
// brasileirao
//
// Created by Tiago Do Couto on 7/24/18.
// Copyright © 2018 coutocode. All rights reserved.
//
import UIKit
@cscouto
cscouto / UIDevice+Model.swift
Created July 31, 2018 22:04
SWIFT - Device model name
extension UIDevice {
var modelName: String {
var systemInfo = utsname()
uname(&systemInfo)
let machineMirror = Mirror(reflecting: systemInfo.machine)
let identifier = machineMirror.children.reduce("") { identifier, element in
guard let value = element.value as? Int8 , value != 0 else { return identifier }
return identifier + String(UnicodeScalar(UInt8(value)))
}
@cscouto
cscouto / String+AES.swift
Created July 31, 2018 23:02
SWIFT - Encrypt/Decrypt AES with CryptoSwift
//
// String+AES.swift
// bitcoin
//
// Created by Tiago Do Couto on 7/31/18.
// Copyright © 2018 coutocode. All rights reserved.
//
import CryptoSwift
@cscouto
cscouto / UILabel+Height.swift
Created August 20, 2018 18:29
SWIFT - UILabel content size for specific width
//
// UILabel+height.swift
// AllBody
//
// Created by Tiago Do Couto on 8/20/18.
// Copyright © 2018 coutocode. All rights reserved.
//
import UIKit
@cscouto
cscouto / ProgressStatusView
Last active March 13, 2019 19:53
SWIFT - Custom progress bar
//
// ProgressView.swift
// CustomProgress
//
// Created by COUTO, TIAGO on 3/12/19.
// Copyright © 2019 Couto Code. All rights reserved.
//
import UIKit