All blogs / Mobile / iOS / Android
Cocoa with Love
Cocoa with Love is Matt Gallagher's long-form blog about Swift, Cocoa, software design and programming.
Mobile / iOS / AndroidSoftware / engineering practiceAI / ML
- Posts
- 205 from 1 Feb 2008 to 8 Jun 2026
- Posting
- now and then (3 in the last year)
- Kind
- personal blog
- Feed
- https://cocoawithlove.com/feed.xml
2026 2
2025 1
2024 1
2021 3
2020 1
2019 6
2018 3
2017 10
- A view construction syntax
- View-state driven applications
- The worst possible application
- CwlLayout: a Swift wrapper around Auto Layout
- About flatMap, compactMap and monads
- Statements, messages and reducers
- Looking at Model-View-Controller in Cocoa
- The weirdest subclass I've ever written
- Using 'swift package fetch' in an Xcode project
- Compiling a Mac OS 8 application on macOS Sierra
2016 26
- A key-value observing wrapper
- Reference counted releases in Swift
- What is reactive programming and why should I use it?
- CwlSignal, a library for reactive programming
- Testing actions over time
- Specifying function execution contexts
- Optimizing a copy-on-write double-ended queue in Swift
- Updating Cocoa with Love for Swift 3
- Values and errors, part 2: eight languages compared
- Values and errors, part 1: 'Result' in Swift
- Design patterns for safe timer usage
- Exponential time complexity in the Swift type checker
- Parsing whitespace in an Xcode extension
- Mutexes and closure capture in Swift
- Random number generators in Swift
- Comparing Swift to C++ for parsing
- Presenting unanticipated errors to users
- Indent with tabs or spaces? I wish I didn't need to know.
- Breaking Swift with reference counted structs
- Errors: unexpected, composite, non-pure, external.
- Gathering system information in Swift with sysctl
- Tracking tasks with stack traces in Swift
- Use it or lose it: why safe C is sometimes unsafe Swift
- Partial functions in Swift, Part 2: Catching precondition failures
- Partial functions in Swift, Part 1: Avoidance
- A new era for Cocoa with Love
2011 10
- A big weakness in Objective-C's weak typing
- An RSS-feed and location-based iOS application
- Classes for fetching and parsing XML or JSON via HTTP
- Presenting a Mac dialog sheet with visual cue effects
- Background audio through an iOS movie player
- User interface strings in Cocoa
- Mac QuartzGL (2D drawing on the graphics card) performance
- A history of iOS media APIs (iPhone OS 2.0 to iOS 4.3)
- Advanced drawing using AppKit
- Submitting functionality for a future version of iOS
2010 41
- UITableView construction, drawing and management (revisited)
- Version control for solo Mac developers
- Back to the Mac? 12 features from iOS I'd like to see in Lion
- A Cocoa application for running scripts
- A deployment script for a generic Cocoa Mac application
- An iOS tone generator (an introduction to AudioUnits)
- Testing if an arbitrary pointer is a valid object pointer
- A ZoomingViewController to animate a UIView to fullscreen
- Minimalist Cocoa programming
- The overhead of spawning threads (a performance experiment)
- Substituting local data for remote UIWebView requests
- Alternative Objective-C object allocation for large arrays
- Is a virtual machine for Cocoa programming inevitable?
- Tips & Tricks for conditional iOS3, iOS3.2 and iOS4 code
- Assign, retain, copy: pitfalls in Obj-C property accessors
- The design of every Mac application
- Sorting an NSMutableArray with a random comparison method
- Avoiding deadlocks and latency in libdispatch
- Handling unhandled exceptions and signals
- 5 ways to draw a 2D shape with a hole in CoreGraphics
- A look at how malloc works on the Mac
- Finding or creating the application support directory
- Porting a Mac program to Windows using The Cocotron
- Design of a multi-platform app using The Cocotron
- Options for porting Objective-C/Cocoa apps to Windows
- Network data requirements on iPhone OS devices
- StreamToMe is available for the iPad!
- Streaming MP3/AAC audio again
- Dynamic ivars: solving a fragile base class problem
- Custom UI Bindings in Interface Builder
- Designing a view with Bindings (UITableView on the Mac)
- Load from NIB or construct views in code: which is faster?
- StreamToMe 2.0 is out (and Cocoa With Love is 2 years old).
- Resolving a path containing a mixture of aliases and symlinks
- The differences between Core Data and a Database
- Custom build rules, generated tables and faster floating point
- Finding the cause of performance issues in your programs
- 5 key-value coding approaches in Cocoa
- What is a meta-class in Objective-C?
- Getting the subclasses of an Objective-C class
- Quality control in application development without unit testing
2009 55
- A sample iPhone application with complete unit tests
- A sample Mac application with complete unit tests
- Multiple copy buffers, cursor and tab key tricks in Xcode
- The design of an iPhone application
- There's a Garbage Collection ninja hiding in the project templates
- Writing a parser using NSScanner (a CSV parsing example)
- Performance tests: Replacing Core Data Key Paths
- A drop-in fix for the problems with NSHost
- Creating iPhone and Mac icons using Inkscape (Part 2 of 2)
- Creating iPhone and Mac icons using Inkscape (Part 1 of 2)
- Memory and thread-safe custom property methods
- How blocks are implemented (and the consequences)
- Objective-C's niche: why it survives in a world of alternatives
- The ugly side of blocks: explicit declarations and casting.
- Optimizing the loading of a very large table on the iPhone
- StreamToMe Version 1.1 available
- WhereIsMyMac, a Snow Leopard CoreLocation project
- Building for earlier OS versions from Snow Leopard
- Creating alpha masks from text on the iPhone and Mac
- An NSSplitView delegate for priority based resizing
- StreamToMe iPhone App Released
- Adding shadow effects to UITableView using CAGradientLayer
- Animating a window to fullscreen on the Mac
- Safe, threaded design and inter-thread communication
- Control and configuration of applications through Info.plist
- Rules to avoid retain cycles
- Temporary files and folders in Cocoa
- A simple, extensible HTTP server in Cocoa
- HashValue: an object for holding MD5 and SHA hashes
- Custom views in Interface Builder using IBPlugins
- Verifying that a string contains an email address using NSPredicate
- Revisiting an old post: Streaming and playing an MP3 stream
- Method names in Objective-C
- Base64 encoding options on the Mac and iPhone
- Simple methods for date formatting and transcoding
- Intercepting status bar touches on the iPhone
- Variable argument lists in Cocoa
- Invoking other processes in Cocoa
- Easy custom UITableView drawing
- What does it mean when you assign [super init] to self?
- Showing a "Loading..." message over the iPhone keyboard
- 8 Confusing Objective-C Warnings and Errors
- Using NSKeyedArchiver to archive a C linked-list
- Recreating UITableViewController to increase code reuse
- Scripted window management in Xcode
- An Asteroids-style game in CoreAnimation, Part Four.
- An Asteroids-style game in CoreAnimation, Part Three.
- An Asteroids-style game in CoreAnimation, Part Two.
- An Asteroids-style game in CoreAnimation, Part One.
- Breadth-first traversal of a graph of Objective-C objects
- Interprocess communication: snooping, intercepting and subverting
- Multiple virtual pages in a UIScrollView with just 2 child views
- Demystifying NSApplication by recreating it
- Multiple row selection and editing in a UITableView
- Serving an NSManagedObjectContext over an NSConnection
2008 46
- Heterogeneous cells in a UITableViewController
- OrderedDictionary: Subclassing a Cocoa class cluster
- Drawing a custom window on Mac OS X
- Instance variable to synthesized property (an Xcode user script)
- Method invocation formatting styles in Objective-C
- Automated user interface testing on the iPhone
- Singletons, AppDelegates and top-level data.
- Simplifying your code using NSDictionary
- Using libxml2 for XML parsing and XPath queries in Cocoa
- Debugging tips for Objective-C programming
- Synthesizing a touch event on the iPhone
- WorldTimeConverter: Dates and timezones in Cocoa
- Sliding UITextFields around to avoid the keyboard
- Streaming and playing an MP3 stream
- A Cocoa application driven by HTTP data
- Drawing gloss gradients in CoreGraphics
- Parametric acceleration curves in Core Animation
- Application Design in AppKit
- Safely fetching an NSManagedObject by URI
- In defense of Objective-C 2.0 Properties
- NSArray or NSSet, NSDictionary or NSMapTable
- String philosophies: char arrays, std::string and NSString
- Key Value Information
- Better integration for NSViewController and NSView
- CoreGraphics curves and lines: a sample app
- NSMapTable: more than an NSDictionary for weak pointers
- Hidden Xcode build, debug and template settings
- Doing things in Cocoa with "nil"
- Speed test: NSManagedObject ObjC-2.0 accessors
- Five approaches to listening, observing and notifying in Cocoa.
- Adapter interfaces in Objective-C, using categories.
- Implementing countByEnumeratingWithState:objects:count:
- Objective-C 2.0: Fast enumeration clarifications
- Square Root: Numerical fun with NSDecimalNumber
- Open the previous document on application startup
- Propagate deletes immediately in Core Data
- viewWillDraw - a welcome addition to NSView in 10.5
- Type punning isn't funny: Using pointers to recast in C is bad.
- The value of immutable values
- Supersequent implementation
- Testing Core Data with very big hierarchical data sets
- Construct an NSInvocation for any message, just by sending
- Cocoa Application Startup
- Break into Debugger
- Core Data: one line fetch
- IMP of the current method