Articles Projects About Subscribe
← All issues Newsletter

iOS Dev Weekly — Issue #50

Opening

Two things can be true at once: we’re building ever richer SwiftUI UIs, and our apps still hitch when layout math gets pushed into view bodies and preference keys. At the same time, privacy landmines keep popping up in production, reminding teams that platform defaults aren’t always protective. This week leans into both: determinism in layout, and discipline in ops.


This Week’s Big Story

Custom SwiftUI Layouts with the Layout Protocol

Stacks are great until they aren’t—like when dynamic content and scrolling expose jitter from view-driven measuring and ad‑hoc alignment. SwiftUI’s Layout protocol gives you a declarative, testable place to put the math so your UI stops negotiating with itself every frame. If you’re juggling “responsive” HStacks, badges, or data-heavy lists, this is the lever that restores predictability—come see how to wield it well.


Trend Signals

• Apple ‘Hide My Email’ vulnerability reveals peoples’ real email addresses — Treat “private relay” assumptions as untrusted; audit any code that pre-fills, logs, or syncs emails and be ready to hotfix. [Source: HackerNews]

• Tell HN: Installing Cursor on iOS irreversibly changes your privacy settings — Early reports suggest third‑party installers may toggle privacy items; MDM and QA checklists should explicitly diff settings pre/post install. [Source: HackerNews]

• Swift Package Index Update — SPI continues to be the quickest signal for platform and Swift version compatibility; teams should pin against what SPI shows actually builds, not what readmes claim. [Source: Swift.org Blog]

• 7 Essential Tools Every iOS Developer Needs in 2026 — Mostly familiar picks, but the takeaway is consolidation: fewer tools, deeper automation—use it to justify cleaning your toolchain. [Source: Medium]


Swift Snippet of the Week

import SwiftUI

struct WeightedHStack: Layout {
    struct WeightKey: LayoutValueKey { static let defaultValue: CGFloat = 0 }
    var spacing: CGFloat = 8
    func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize {
        let w = proposal.width
        let sp = CGFloat(max(subviews.count - 1, 0)) * spacing
        if w == nil {
            var totalW: CGFloat = sp, maxH: CGFloat = 0
            for s in subviews {
                let sz = s.sizeThatFits(.unspecified)
                totalW += sz.width; maxH = max(maxH, sz.height)
            }
            return CGSize(width: totalW, height: maxH)
        }
        let weights = subviews.map { $0[WeightKey.self] }
        let totalWeight = weights.reduce(0,+)
        var naturalNonWeighted: CGFloat = 0
        var idealSizes = Array(repeating: CGSize.zero, count: subviews.count)
        for i in subviews.indices where weights[i] == 0 {
            let sz = subviews[i].sizeThatFits(.unspecified)
            idealSizes[i] = sz; naturalNonWeighted += sz.width
        }
        let remaining = max(w! - sp - naturalNonWeighted, 0)
// … (truncated for newsletter)

This pattern makes width allocation an explicit policy (weights vs. natural sizes) in one place, which reduces layout thrash, improves scroll smoothness, and gives you a single abstraction to unit test.


Community Picks

Apple ‘Hide My Email’ vulnerability reveals peoples’ real email addresses — Worth a read before your next release; verify masking logic and telemetry are actually de‑identified.

Tell HN: Installing Cursor on iOS irreversibly changes your privacy settings — If your QA devices run third‑party tooling, add a privacy settings baseline check to your test plan.

7 Essential Tools Every iOS Developer Needs in 2026 — Skim for gaps in your stack; use it as a prompt to retire overlapping utilities.


Until Next Time

If layout bugs only show up under scroll or data spikes, you’re the target reader for this week’s piece—go deeper on the Layout protocol and ship smoother UIs. Read the full article and then hit reply with the nastiest layout you’ve tamed or forward this to a teammate who owns your design system. I’ll also be chatting about this on LinkedIn—join in and tell me where Layout has (or hasn’t) paid off for your team.