Skip to content

Instantly share code, notes, and snippets.

View Shubham-0812's full-sized avatar
🎯
Focusing

Shubham Singh Shubham-0812

🎯
Focusing
View GitHub Profile
import UIKit
struct Downsampler {
// MARK: - functions
static func downsampleImage(imageURL: URL, frameSize: CGSize,
scale: CGFloat = UIScreen.main.scale) -> UIImage? {
/// creates an CGImageSource that represent an image
let imageSourceOptions = [kCGImageSourceShouldCache: false] as CFDictionary
guard let imageSource = CGImageSourceCreateWithURL(imageURL as CFURL, imageSourceOptions) else {
import Foundation
import OSLog
enum LogType {
case info
case notice
case warning
case fault
// case debug
@Shubham-0812
Shubham-0812 / Extensions.swift
Created August 14, 2023 14:54
Extensions + Utils
import SwiftUI
extension Color {
init(hex: String) {
self.init(UIColor(hex: hex))
}
}
extension UIColor {