Skip to content

Instantly share code, notes, and snippets.

View eugenebokhan's full-sized avatar
📚

eugene eugenebokhan

📚
View GitHub Profile
@eugenebokhan
eugenebokhan / GetPrivateProperties.swift
Created July 10, 2019 14:13
Get Private Properties
import Foundation
func getProperties(of object: AnyObject) -> [Any?] {
return self.getPropertyNames(of: type(of: object)).map { value(forKey: $0) }
}
func getPropertyNames(of type: AnyClass) -> [String] {
var count: UInt32 = 0
let propertyList = class_copyPropertyList(type, &count)
let propertyArray = Array(UnsafeBufferPointer(start: propertyList, count: Int(count)))
@eugenebokhan
eugenebokhan / CGImage+Resize.swift
Last active March 19, 2025 16:15
UIImage + Resize
import CoreGraphics
import Accelerate
import CoreImage
import UIKit
extension CGImage {
public enum Error: Swift.Error {
case imageResizingFailed
case cgContextCreationFailed