Skip to content

Instantly share code, notes, and snippets.

View GoNinja's full-sized avatar

João Mota GoNinja

  • Lisboa, Portugal
View GitHub Profile
@GoNinja
GoNinja / UINavigationController+Root.swift
Created November 29, 2018 16:14 — forked from rsaenzi/UINavigationController+Root.swift
To add completion handlers to push, pop and popToRoot functions
//
// UINavigationController+Root.swift
//
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/)
// Copyright © 2017. All rights reserved.
//
import UIKit
extension UINavigationController {
@GoNinja
GoNinja / FontNames-iOS12.swift
Created September 27, 2018 18:14 — forked from tadija/FontNames-iOS-17.4.swift
iOS - All Font Names
/*
*** Academy Engraved LET ***
AcademyEngravedLetPlain
---------------------
*** Al Nile ***
AlNile
AlNile-Bold
---------------------
*** American Typewriter ***
AmericanTypewriter
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
let formatter = NSDateFormatter()
formatter.dateFormat = "y" //A year with at least 1 digit.
formatter.dateFormat = "yy" //A year with 2 digits. If less, it is padded with a zero. It will be truncated to the tens digit if larger.
formatter.dateFormat = "yyyy" //A year with at least 3 digits. If less, it is padded with zeros.
formatter.dateFormat = "yyyy" //A year with at least 3 digits. If less, it is padded with zeros.
formatter.dateFormat = "M" //A year with at least 1 digits.
formatter.dateFormat = "MM" //A month with at least 2 digits. If less, it is padded with zeros.
formatter.dateFormat = "MMM" //Three letter month abbreviation.
formatter.dateFormat = "MMMM" //Full name of month.
formatter.dateFormat = "MMMMM" //One letter month abbreviation. Not unique, January, June, and July are all “J”.
import Foundation
import UIKit
enum DeviceMaxWidth: Float {
case iPhone4 = 480.0
case iPhone5 = 568.0
case iPhone6 = 667.0
case iPhone6Plus = 736.0
case iPad = 1024.0
case iPadPro = 1366.0
for familyName in UIFont.familyNames as [String] {
print("\(familyName)")
for fontName in UIFont.fontNames(forFamilyName: familyName) as [String] {
print("\tFont: \(fontName)")
}
}