Skip to content

Instantly share code, notes, and snippets.

View sauvikatinnofied's full-sized avatar

Sauvik Dolui sauvikatinnofied

View GitHub Profile
@sauvikatinnofied
sauvikatinnofied / FontTypeSizeAllEnums.swift
Last active February 16, 2019 05:54
MediumBlogPost_FontHandling_Gist_3
enum FontType {
case installed(FontName)
case custom(String)
case system
case systemBold
case systemItatic
case systemWeighted(weight: Double)
case monoSpacedDigit(size: Double, weight: Double)
}
enum FontSize {
@sauvikatinnofied
sauvikatinnofied / FontName_Size_Enum.swift
Last active January 3, 2017 22:53
MediumBlogPost_FontHandling_Gist_1
enum FontName: String {
case RobotoBlack = "Roboto-Black"
case RobotoBlackItalic = "Roboto-BlackItalic"
case RobotoBold = "Roboto-Bold"
case RobotoBoldItalic = "Roboto-BoldItalic"
case RobotoItalic = "Roboto-Italic"
case RobotoLight = "Roboto_Light"
case RobotoLightItalic = "Roboto-LightItalic"
case RobotoMedium = "Roboto-Medium"
case RobotoMediumItalic = "Roboto-MediumItalic"
@sauvikatinnofied
sauvikatinnofied / Utility.swift
Last active January 3, 2017 20:34
MediumBlogPost_FontHandling_Gist_1
class Utility {
/// Logs all available fonts from iOS SDK and installed custom font
class func logAllAvailableFonts() {
for family in UIFont.familyNames {
print("\(family)")
for name in UIFont.fontNames(forFamilyName: family) {
print(" \(name)")
}
}
import Foundation
import UIKit
// Usage Examples
let shadowColor = Color.shadow.value
let shadowColorWithAlpha = Color.shadow.withAlpha(0.5)
let customColorWithAlpha = Color.custom(hexString: "#123edd", alpha: 0.25).value
enum Color {
@sauvikatinnofied
sauvikatinnofied / UIColorNewWay.swift
Last active January 2, 2017 06:26
Medium Blog ColorConstant
let shadowColor = Color.shadow.value
let shadowColorWithAlpha = Color.shadow.withAlpha(0.5)
let customColorWithAlpha = Color.custom(hexString: "#123edd", alpha: 0.25).value
@sauvikatinnofied
sauvikatinnofied / UIColorOldWay.swift
Last active December 31, 2016 13:16
Medium Blog ColorConstant
let shadowColor = UIColor(red: 204.0/255.0, green: 204.0/255.0, blue: 204.0/255.0, alpha: 1.0)
let shadowColorWithAlpha = UIColor(red: 204.0/255.0, green: 204.0/255.0, blue: 204.0/255.0, alpha: 0.5)
let customColorWithAlpha = UIColor(red: 18.0/255.0, green: 62.0/255.0, blue: 221.0/255.0, alpha: 0.25)
@sauvikatinnofied
sauvikatinnofied / ThemeColor.swift
Last active March 23, 2017 12:54
MediumBlog Colour schemes
extension Color {
var value: UIColor {
var instanceColor = UIColor.clear
switch self {
case .border:
instanceColor = UIColor(hexString: "#333333")
case .theme:
instanceColor = UIColor(hexString: "#ffcc00")
@sauvikatinnofied
sauvikatinnofied / ColorScheme.swift
Last active March 23, 2017 12:54
Color Scheme Categories
enum Color {
case theme
case border
case shadow
case darkBackground
case lightBackground
case intermidiateBackground
@sauvikatinnofied
sauvikatinnofied / UIColorExtension.swift
Last active July 3, 2020 14:03
MediumBlog Color Constant
extension UIColor {
/**
Creates an UIColor from HEX String in "#363636" format
- parameter hexString: HEX String in "#363636" format
- returns: UIColor from HexString
*/
convenience init(hexString: String) {
├─ Level // Root Folder
	├─ 3rdParty (Any 3rd party which can not added through package manager)
	├─ AppDelegate
		├─ AppDelegate.swift
		├─ AppDelegateBGSupport.swift (extension of AppDelegate, methods associated with background support (prefetching, download etc))
		├─ AppDelegateNotificationSupport.swift (extension of AppDelegate, methods associated with Notification(Push, Local) support)
	├─ Controllers
		├─ Feedback
			├─ Controllers (View controllers  strictly associated with Feedback Module)