---
title: "How we added Mac support to Cribbit"
description: "Four days after the first Cribbit build, one prompt asked for Mac. The Mac can be either end of the monitor — but its camera has different rules than an iPhone."
date: "2026-12-02"
app: cribbit
kind: build
readingTime: "6 min read"
image: "/img/build/cribbit/mac-monitor.jpg"
imageAlt: "The Mac app as the parent monitor, showing the nursery feed on screen"
---

Four days after the first line of Cribbit was written, one prompt asked for Mac support. That question opened a thread of work that looked like a port and turned out to be something more specific.

## The prompt

> can we make , add mac app support also ?

The assumption going in was that the Mac would be the parent screen only — the device you watch on, not the nursery camera. Someone at a laptop, keeping an eye on the feed while they work. The iPhone handles the camera; the Mac handles the display.

The plan that came back was different. A Mac can run a camera, encode video, and stream it over a local network the same as an iPhone. The pairing and transport layer was already abstracted. So the Mac app would work as either end: set it to nursery and it becomes the camera. Set it to parent and it watches. The same pairing, the same encryption, the same wire format.

![The Mac role-choice screen, asking whether this Mac will be the nursery camera or the parent monitor](/img/build/cribbit/mac-role-choice.jpg)
*The role screen, shown once at first launch. The Mac can be either end of the monitor.*

Building the parent screen took a few hours. The same live video decoder, the same frog status character on top of the frame, a Mac-sized layout. It paired with an iPhone and streamed video cleanly. The nursery camera path took a few more hours: camera capture, hardware encode, the compression settings, handing off the bitstream to the same transport the iPhone uses. That worked too.

## Floating the monitor

> for the macos , when we are monitoring with it, can we add picture in picture mode ? with the monitor being able to move anywhere around in the mac ?

A baby monitor on a Mac is not the same use as a monitor on a phone. On a phone you close everything else. On a Mac you keep other windows open and you want the nursery view in a corner somewhere. It has to stay out of the way and still be readable.

The floating window does one thing: it moves freely. Drag it anywhere on the screen, resize it smaller, leave it over a browser or a text editor. The NSPanel configuration that makes this work — `NSWindowStyleMask.nonactivatingPanel` combined with `NSWindowLevel.floating` — keeps the window on top of other apps without stealing keyboard focus from whatever you are typing in. Click the floating window and it brings Cribbit to the front. Click anywhere else and focus returns to the other app without the monitor window disappearing behind it.

The frog's status state renders at every size down to the smallest readable frame, so you can tell at a glance whether the nursery is Live, Stalled or Lost without switching to the full Cribbit window.

## Where the camera broke

> it crashed now but when i clicked low light i think

The Low Light button on the nursery screen puts the camera into an extended-exposure mode that brightens a dark room. On iPhone, this calls `AVCaptureDevice.setExposureMode` with custom duration and ISO values. The call works on every iPhone camera that ships with the app. On the Mac it threw `NSInvalidArgumentException` on the first device we tested and silently did nothing on the second.

Mac cameras range from the older FaceTime HD camera to the Center Stage unit to external webcams. Not all of them support custom exposure settings. AVFoundation's camera API does not differentiate between cameras that support a given mode and cameras that accept the call and ignore it, or cameras that accept it and crash. The common failure mode on a constrained camera is an exception that does not say which setting is unsupported.

The fix was to check `AVCaptureDevice.isExposureModeSupported(.custom)` before showing the Low Light button at all. If the camera connected to the Mac does not support it, the control does not appear. If a different camera is connected later, the check runs again when Cribbit selects it.

This is the check you would want to run before any capability-dependent camera API, not only exposure mode. The iPhone's camera family is consistent enough that the check rarely changes anything. The Mac's is not. Any Mac app that calls camera APIs should guard each one this way, because the same macOS version running on two different Macs may respond to the same call differently depending on the camera hardware present.

## Pairing the Mac

Cribbit pairs by typing a six-character code from one screen into the other. The Mac shows the same pairing screen in both roles — nursery or parent — and the code entry works the same way.

![Mac pairing, with a text field for the six-character code shown on the other device](/img/build/cribbit/mac-pairing.jpg)
*Mac pairing works the same as iPhone: type the code shown on the other device.*


## What the Mac work cost

Adding the Mac took about a day of building spread over two sessions. The straightforward pieces were the layout, pairing, and the shared transport. The two pieces that took longer were the floating monitor window and the low-light crash.

The floating window was mostly getting the NSPanel behaviour right: the difference between a floating panel that stays visible and one that cycles through z-order like a normal window is a few mask flags, but finding the right combination takes testing against different apps and system states. About an hour.

The low-light crash was quicker to find than to understand. The backtrace pointed at the exposure call; working out which capability check to guard it with required reading AVFoundation's documentation for modes rather than properties, since `isExposureModeSupported` is not at the same call site as `setExposureMode`. Once found, the fix was small.

The core lesson from the Mac work is narrow but reliable: capabilities you can assume on iPhone are not guaranteed on Mac. The hardware is heterogeneous, the AVFoundation API accepts calls that the camera cannot honour, and the failure is an exception rather than a return value. Check capability before commanding it, and the app works on whatever camera is connected. Skip the check, and the first edge case you meet crashes.

The Cribbit beta is on TestFlight at [cribbit.xeve.io](https://cribbit.xeve.io).
