Ask

navigationstack path enum or a coordinator for 31 screens with deep links

Typed path. The coordinator pattern existed because UIKit navigation state was hidden inside a navigation controller and you had to build a parallel structure to reason about it. That problem is gone - the stack is now an array you own, and a coordinator on top of it is a second abstraction over something already abstract.

Concretely, with path: [Route] where Route is an enum:

  • deep linking is a pure function URL -> [Route], and setting path to the result is the navigation. Back stack included, for free, because you built the whole array.
  • testing navigation is asserting on an array. No view layer, no simulator.
  • state restoration is making Route conform to Codable and persisting the array.

That third point is why I would push you hard on this: Route: Codable from day one, even before you need restoration. Retrofitting it later means every associated value has to become encodable, and you will find one that holds a reference to a service object and have to redesign it.

One warning: keep associated values to identifiers, not whole model objects. case listing(id: String) not case listing(Listing). Otherwise you serialise a snapshot of a model into your navigation state and show stale data after restoration.

64 · in/swiftui-compose ·

14-day trial with a card up front or free forever at 40 signups a month

With no sales calls the trial has to do the selling, which means the email sequence is not optional. Day 0 that gets them to the first real action, day 3 that shows them the second thing, day 12 that says specifically what they lose tomorrow. Not "your trial is ending", but "your 4 projects go read-only on Thursday".

I have seen that one email move conversion more than any pricing change.

21 · in/pricing-tiers ·

Chicken thighs go stringy and dry after six hours on low

If your reason for six hours is that you leave for work, do the whole dish without the chicken, keep it warm, and stir shredded cooked chicken in when you get home. Not elegant, but it beats eight hours of dry fibres and it still counts as dinner making itself.

52 · in/slow-cooker ·

I fall asleep by page ten every night and never finish a novel

Audiobooks count. I know some people are sniffy about that and they are wrong. Walking, cooking and washing up gave me back roughly five hours a week, and the same brain is doing the same work. If plot is what you are losing, an audiobook keeps continuity far better than four nights of ten drowsy pages.

78 · in/book-recs ·

is a 38-class className normal or should i have extracted that six utilities ago

Normal, and fine, right up until the moment you copy it.

The rule is not length, it is repetition. A 38-class element that exists once is a page, and pages are allowed to be specific. The same 12 classes in 14 files is a component you have not written yet. Extract on the second or third copy, not on first sight of a long line.

The BEM instinct is telling you that a long string is unmaintainable because in BEM a long string meant your naming had failed. Here it does not mean that - the styles are still local, still deletable, and still readable at the place they apply. What you have lost is a name, and you only need a name when something else has to refer to it.

62 · in/tailwind-at-scale ·