Valentino Urbano
iOS Developer, Swift, Writer, Husband
NSTextField send on enter only
The default action, when you connect a textField in Interface Builder, it’s to send the action each time the value is changed. Doing so means that if my view controller would be dismissed it would trigger the value changed action if I touched the textField in any way. Probably worse...
Email Newsletter
Update 2016-02-12: Notice that email RSS will be shut down soon. More Info
Add more information to default "About Panel" in Mac OSX
Apple provides a simple way to call the default “About Panel” to display copyright information and another kind of legal/license/… related information. It takes the information available in the Info.plist1 of your application and shows them: NSApplication.sharedApplication().orderFrontStandardAboutPanel(self)2 It shows the icon, the name and the version of your app in...
MenuItem Image as Template for Mac OsX MenuBar
Every menubar app has its own custom icon, usually, the image is white if the theme of the menubar is set as dark and black vice-versa. It’s important to do that to maintain consistency between every icon in your menu bar so that it doesn’t stand out, in a bad...
Enumerate enums - Getting all values in an enum
It sounded strange to me, but there is no way to enumerate all the cases of an enum automatically baked in the language. As an example I had this enum for three different strings that corresponded to 3 Identifiers of NSToolbarItems: