The Curious Engineer

All blogs / Mobile / iOS / Android

Cocoa with Love

cocoawithlove.com

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

  1. Training an LLM in Swift, Part 2: macOS built-in frameworks
  2. Training an LLM in Swift, Part 1: Taking matrix multiplication from Gflop/s to Tflop/s

2025 1

  1. Have LLMs improved for Swift coding in the last 12 months?

2024 1

  1. Using Copilot to write a raindrop audio synthesizer using AVAudioEngine

2021 3

  1. App architecture basics in SwiftUI Part 4: Services
  2. App architecture basics in SwiftUI Part 3: Module-separated layers
  3. App architecture basics in SwiftUI, Part 2: SwiftUI's natural pattern

2020 1

  1. App architecture basics in SwiftUI, Part 1: Coding through iteration and integration

2019 6

  1. 22 short tests of combine – Part 3: Asynchrony
  2. 22 short tests of combine – Part 2: Sharing
  3. 22 short tests of Combine – Part 1: Protocols
  4. First impressions of SwiftUI
  5. Declarative Views
  6. Introducing CwlViews

2018 3

  1. Article updates, 2018 edition
  2. A Farewell to StreamToMe
  3. Model-View-Controller without the Controller

2017 10

  1. A view construction syntax
  2. View-state driven applications
  3. The worst possible application
  4. CwlLayout: a Swift wrapper around Auto Layout
  5. About flatMap, compactMap and monads
  6. Statements, messages and reducers
  7. Looking at Model-View-Controller in Cocoa
  8. The weirdest subclass I've ever written
  9. Using 'swift package fetch' in an Xcode project
  10. Compiling a Mac OS 8 application on macOS Sierra

2016 26

  1. A key-value observing wrapper
  2. Reference counted releases in Swift
  3. What is reactive programming and why should I use it?
  4. CwlSignal, a library for reactive programming
  5. Testing actions over time
  6. Specifying function execution contexts
  7. Optimizing a copy-on-write double-ended queue in Swift
  8. Updating Cocoa with Love for Swift 3
  9. Values and errors, part 2: eight languages compared
  10. Values and errors, part 1: 'Result' in Swift
  11. Design patterns for safe timer usage
  12. Exponential time complexity in the Swift type checker
  13. Parsing whitespace in an Xcode extension
  14. Mutexes and closure capture in Swift
  15. Random number generators in Swift
  16. Comparing Swift to C++ for parsing
  17. Presenting unanticipated errors to users
  18. Indent with tabs or spaces? I wish I didn't need to know.
  19. Breaking Swift with reference counted structs
  20. Errors: unexpected, composite, non-pure, external.
  21. Gathering system information in Swift with sysctl
  22. Tracking tasks with stack traces in Swift
  23. Use it or lose it: why safe C is sometimes unsafe Swift
  24. Partial functions in Swift, Part 2: Catching precondition failures
  25. Partial functions in Swift, Part 1: Avoidance
  26. A new era for Cocoa with Love

2011 10

  1. A big weakness in Objective-C's weak typing
  2. An RSS-feed and location-based iOS application
  3. Classes for fetching and parsing XML or JSON via HTTP
  4. Presenting a Mac dialog sheet with visual cue effects
  5. Background audio through an iOS movie player
  6. User interface strings in Cocoa
  7. Mac QuartzGL (2D drawing on the graphics card) performance
  8. A history of iOS media APIs (iPhone OS 2.0 to iOS 4.3)
  9. Advanced drawing using AppKit
  10. Submitting functionality for a future version of iOS

2010 41

  1. UITableView construction, drawing and management (revisited)
  2. Version control for solo Mac developers
  3. Back to the Mac? 12 features from iOS I'd like to see in Lion
  4. A Cocoa application for running scripts
  5. A deployment script for a generic Cocoa Mac application
  6. An iOS tone generator (an introduction to AudioUnits)
  7. Testing if an arbitrary pointer is a valid object pointer
  8. A ZoomingViewController to animate a UIView to fullscreen
  9. Minimalist Cocoa programming
  10. The overhead of spawning threads (a performance experiment)
  11. Substituting local data for remote UIWebView requests
  12. Alternative Objective-C object allocation for large arrays
  13. Is a virtual machine for Cocoa programming inevitable?
  14. Tips & Tricks for conditional iOS3, iOS3.2 and iOS4 code
  15. Assign, retain, copy: pitfalls in Obj-C property accessors
  16. The design of every Mac application
  17. Sorting an NSMutableArray with a random comparison method
  18. Avoiding deadlocks and latency in libdispatch
  19. Handling unhandled exceptions and signals
  20. 5 ways to draw a 2D shape with a hole in CoreGraphics
  21. A look at how malloc works on the Mac
  22. Finding or creating the application support directory
  23. Porting a Mac program to Windows using The Cocotron
  24. Design of a multi-platform app using The Cocotron
  25. Options for porting Objective-C/Cocoa apps to Windows
  26. Network data requirements on iPhone OS devices
  27. StreamToMe is available for the iPad!
  28. Streaming MP3/AAC audio again
  29. Dynamic ivars: solving a fragile base class problem
  30. Custom UI Bindings in Interface Builder
  31. Designing a view with Bindings (UITableView on the Mac)
  32. Load from NIB or construct views in code: which is faster?
  33. StreamToMe 2.0 is out (and Cocoa With Love is 2 years old).
  34. Resolving a path containing a mixture of aliases and symlinks
  35. The differences between Core Data and a Database
  36. Custom build rules, generated tables and faster floating point
  37. Finding the cause of performance issues in your programs
  38. 5 key-value coding approaches in Cocoa
  39. What is a meta-class in Objective-C?
  40. Getting the subclasses of an Objective-C class
  41. Quality control in application development without unit testing

2009 55

  1. A sample iPhone application with complete unit tests
  2. A sample Mac application with complete unit tests
  3. Multiple copy buffers, cursor and tab key tricks in Xcode
  4. The design of an iPhone application
  5. There's a Garbage Collection ninja hiding in the project templates
  6. Writing a parser using NSScanner (a CSV parsing example)
  7. Performance tests: Replacing Core Data Key Paths
  8. A drop-in fix for the problems with NSHost
  9. Creating iPhone and Mac icons using Inkscape (Part 2 of 2)
  10. Creating iPhone and Mac icons using Inkscape (Part 1 of 2)
  11. Memory and thread-safe custom property methods
  12. How blocks are implemented (and the consequences)
  13. Objective-C's niche: why it survives in a world of alternatives
  14. The ugly side of blocks: explicit declarations and casting.
  15. Optimizing the loading of a very large table on the iPhone
  16. StreamToMe Version 1.1 available
  17. WhereIsMyMac, a Snow Leopard CoreLocation project
  18. Building for earlier OS versions from Snow Leopard
  19. Creating alpha masks from text on the iPhone and Mac
  20. An NSSplitView delegate for priority based resizing
  21. StreamToMe iPhone App Released
  22. Adding shadow effects to UITableView using CAGradientLayer
  23. Animating a window to fullscreen on the Mac
  24. Safe, threaded design and inter-thread communication
  25. Control and configuration of applications through Info.plist
  26. Rules to avoid retain cycles
  27. Temporary files and folders in Cocoa
  28. A simple, extensible HTTP server in Cocoa
  29. HashValue: an object for holding MD5 and SHA hashes
  30. Custom views in Interface Builder using IBPlugins
  31. Verifying that a string contains an email address using NSPredicate
  32. Revisiting an old post: Streaming and playing an MP3 stream
  33. Method names in Objective-C
  34. Base64 encoding options on the Mac and iPhone
  35. Simple methods for date formatting and transcoding
  36. Intercepting status bar touches on the iPhone
  37. Variable argument lists in Cocoa
  38. Invoking other processes in Cocoa
  39. Easy custom UITableView drawing
  40. What does it mean when you assign [super init] to self?
  41. Showing a "Loading..." message over the iPhone keyboard
  42. 8 Confusing Objective-C Warnings and Errors
  43. Using NSKeyedArchiver to archive a C linked-list
  44. Recreating UITableViewController to increase code reuse
  45. Scripted window management in Xcode
  46. An Asteroids-style game in CoreAnimation, Part Four.
  47. An Asteroids-style game in CoreAnimation, Part Three.
  48. An Asteroids-style game in CoreAnimation, Part Two.
  49. An Asteroids-style game in CoreAnimation, Part One.
  50. Breadth-first traversal of a graph of Objective-C objects
  51. Interprocess communication: snooping, intercepting and subverting
  52. Multiple virtual pages in a UIScrollView with just 2 child views
  53. Demystifying NSApplication by recreating it
  54. Multiple row selection and editing in a UITableView
  55. Serving an NSManagedObjectContext over an NSConnection

2008 46

  1. Heterogeneous cells in a UITableViewController
  2. OrderedDictionary: Subclassing a Cocoa class cluster
  3. Drawing a custom window on Mac OS X
  4. Instance variable to synthesized property (an Xcode user script)
  5. Method invocation formatting styles in Objective-C
  6. Automated user interface testing on the iPhone
  7. Singletons, AppDelegates and top-level data.
  8. Simplifying your code using NSDictionary
  9. Using libxml2 for XML parsing and XPath queries in Cocoa
  10. Debugging tips for Objective-C programming
  11. Synthesizing a touch event on the iPhone
  12. WorldTimeConverter: Dates and timezones in Cocoa
  13. Sliding UITextFields around to avoid the keyboard
  14. Streaming and playing an MP3 stream
  15. A Cocoa application driven by HTTP data
  16. Drawing gloss gradients in CoreGraphics
  17. Parametric acceleration curves in Core Animation
  18. Application Design in AppKit
  19. Safely fetching an NSManagedObject by URI
  20. In defense of Objective-C 2.0 Properties
  21. NSArray or NSSet, NSDictionary or NSMapTable
  22. String philosophies: char arrays, std::string and NSString
  23. Key Value Information
  24. Better integration for NSViewController and NSView
  25. CoreGraphics curves and lines: a sample app
  26. NSMapTable: more than an NSDictionary for weak pointers
  27. Hidden Xcode build, debug and template settings
  28. Doing things in Cocoa with "nil"
  29. Speed test: NSManagedObject ObjC-2.0 accessors
  30. Five approaches to listening, observing and notifying in Cocoa.
  31. Adapter interfaces in Objective-C, using categories.
  32. Implementing countByEnumeratingWithState:objects:count:
  33. Objective-C 2.0: Fast enumeration clarifications
  34. Square Root: Numerical fun with NSDecimalNumber
  35. Open the previous document on application startup
  36. Propagate deletes immediately in Core Data
  37. viewWillDraw - a welcome addition to NSView in 10.5
  38. Type punning isn't funny: Using pointers to recast in C is bad.
  39. The value of immutable values
  40. Supersequent implementation
  41. Testing Core Data with very big hierarchical data sets
  42. Construct an NSInvocation for any message, just by sending
  43. Cocoa Application Startup
  44. Break into Debugger
  45. Core Data: one line fetch
  46. IMP of the current method