Jan 28 2019
Get the modification (or creation) date of a file
Xcode 10, Swift 4.2, macOS 10.13 func fileModificationDate(url: URL) -> Date? { do { let attr = try FileManager.default.attributesOfItem(atPath: url.path) return attr[FileAttributeKey.modificationDate] as? Date } catch { return nil } } FileAttributeKey.creationDate works exactly the same; .size and .type might also be of interest. This beautiful and elegant solution comes from this Stackoverflow answer and […]
Jan 29 2019
NSColorWell/NSTextField Bug
Xcode 10, Swift 4.2, macOS 10.13. I have two text fields in my preference controller. Their purpose is to allow users to set a preferred default text style, which I will use elsewhere in my application. (This can be handled much more smoothly, but I have other problems to work out, and right now, working […]
By Extelligent Cocoa • Bug Reports, Interface • • Tags: NSColorWell