This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Muhammad Ashir Mubeen on 13/07/2022. | |
// | |
#if os(iOS) || os(tvOS) | |
import UIKit | |
#elseif os(OSX) | |
import AppKit | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
enum AppStoryboard : String{ | |
case Main = "Main" | |
case PreLogin = "Payment" | |
var instance : UIStoryboard { | |
return UIStoryboard(name: self.rawValue, bundle: Bundle.main) | |
} | |
func viewController<T>(vc : T.Type) -> T where T: UIViewController{ | |
let identifier = String(describing: T.self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Data { | |
private static let mimeTypeSignatures: [UInt8 : String] = [ | |
0xFF : "image/jpeg", | |
0x89 : "image/png", | |
0x47 : "image/gif", | |
0x49 : "image/tiff", | |
0x4D : "image/tiff", | |
0x25 : "application/pdf", | |
0xD0 : "application/vnd", | |
0x46 : "text/plain", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSProgressIndicator { | |
func set(tintColor: NSColor) { | |
guard let adjustedTintColor = tintColor.usingColorSpace(.deviceRGB) else { | |
contentFilters = [] | |
return | |
} | |
let tintColorRedComponent = adjustedTintColor.redComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Units { | |
public let bytes: Int64 | |
public var kilobytes: Double { | |
return Double(bytes) / 1_024 | |
} | |
public var megabytes: Double { | |
return kilobytes / 1_024 |