Extelligent Cocoa
Because one brain is not enough
RSS
  • Home
  • About…
Status Bar App

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

Serial Numbers

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(){ […]

By Extelligent Cocoa • Extensions • • Tags: Serial Numbers

Nov 27 2016

Basic (generic) swap function

(Swift 3) var a: Int = 15 var b: Int = 12 func swap( a: inout Int, b: inout Int){ (a, b) = (b, a) } print(“a is \(a) “) //15 swap(a: &a, b: &b) print(“a is \(a) “) //12 So far, so good. I really like that this is doing away with the extra […]

By Extelligent Cocoa • Wiki • • Tags: generics

«< 2 3 4 5 6

Categories

  • Application Design
  • Bug Reports
  • Coding Meta
  • Design Patterns
  • EC Meta
  • Extensions
  • File Handling
  • Frameworks
  • Graphics
  • Interface
  • Operators
  • Real World Swift
  • Resources
  • SpriteKit
  • Teaching Programming
  • Tutorials
  • Wiki

Recent Posts

  • NSOutlineView: Saving expansion status
  • Saving a font to UserDefaults
  • Disclosure Triangle (Autolayout)
  • NSColorWell/NSTextField Bug
  • Get the modification (or creation) date of a file

Archives

  • August 2020
  • March 2020
  • September 2019
  • January 2019
  • August 2018
  • May 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • July 2017
  • June 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016

Recent Wiki

  • Saving a font to UserDefaultsSaving a font to UserDefaults
    (Here using macOS 13, Xcode 10, Swift 4.2, but
  • Get the modification (or creation) date of a fileGet the modification (or creation) date of a file
    Xcode 10, Swift 4.2, macOS 10.13 func
  • NSDocumentController basicsNSDocumentController basics
    Xcode 10, macOS 13.5, Swift 4.2 Without wanting to
  • NSStackView TutorialNSStackView Tutorial
    (Xcode 9, macOS 10.12, Swift 4) Stackviews exist
  • Filetypes and UTIsFiletypes and UTIs
    macOS 10.12 (I will update this post once I’ve

Tags

AppDelegate Autolayout closures Codable containerView Core Data disclosure embed view enums FileAttributeKey FileManager generics initialFirstResponder NSAlert NSApplication.ModalResponse NSApplicationDelegate NSButton NSCoding NSColorWell NSDocumentController NSFont NSFontDescriptor NSImageView NSKeyedArchiver NSKeyedUnarchiver NSOpenPanel NSOutlineView NSPopover NSSavePanel NSScrollView NSStackView NSStoryboardSegue NSTextField NSTextFieldDelegate NSTitlebarAccessoryViewController NSToolbar NSToolbarItem NSView NSWindowController sheets singletons SKView storyboards UserDefaults zoom

↑

© Extelligent Cocoa 2022
Powered by WordPress • Themify WordPress Themes