Dec 5 2016
Serial Numbers
macOS 10.11/Xcode 8.0 Sometimes, you want items to have serial numbers. This is, to me, the neatest way of creating such unique identifiers – simply use a static variable, and assign it to each new item before incrementing it in the initialiser. class HazSerialNumber { static var serialCounter: Int = 1 let serial: Int init(){ […]
Dec 6 2016
Status Bar App
(This post is based on https://www.raywenderlich.com/98178/os-x-tutorial-menus-popovers-menu-bar-apps), expanded and updated for Swift 3. This seems to be the only tutorial in town – at least I’ve seen a couple of other tutorials that were suspiciously similar, right down to the architecture and the location of the event monitoring code.) Xcode 8.0, macOS 10.11 1) Start simple: […]
By Extelligent Cocoa • Application Design, Tutorials • • Tags: NSEventMask, NSMenu, NSPopover, NSStatusBar