Skip to content

Instantly share code, notes, and snippets.

View wxxsw's full-sized avatar
😴
👨‍👩‍👧📱🧑‍💻🛵💪

Gesen wxxsw

😴
👨‍👩‍👧📱🧑‍💻🛵💪
View GitHub Profile
let cls = "_UIAppearance"
var count: UInt32 = 0
let properties = class_copyPropertyList(NSClassFromString(cls),
&count)
for i in 0..<Int(count) {
let property = properties![i]
let name = property_getName(property)
let nameString = NSString(cString: name, encoding: String.Encoding.utf8.rawValue)
extension NSImage {
func makeImage(tintColor: NSColor) -> NSImage {
let image = copy() as! NSImage
image.lockFocus()
tintColor.set()
NSRectFillUsingOperation(NSMakeRect(0, 0, image.size.width, image.size.height), .sourceAtop)