Swift PiecesPro
  • Library
    Screens48Finished, designed screens for real apps.Templates10Complete apps built from the screens.Build Kit24Styles, briefs and recipes for your coding agentEverything58The whole library, with search
  • Docs
  • Pro

Library

  • Screens48
  • Templates10
  • Build Kit24
  • Everything58
  • Docs
  • Pro
  • Account
Get Swift Pieces ProFree library ↗
Swift PiecesPro

Production-ready SwiftUI screens and app templates for iOS. The pieces to build the whole app.

Library

  • Screens
  • Templates
  • Build Kit
  • Everything

Product

  • Pro
  • Your account
  • Sign in

Resources

  • Docs
  • CLI
  • MCP and agents
  • Free library

Social

  • X / Twitter
  • GitHub

SWIFTPIECES PRO

© 2026 Swift Pieces. One payment, lifetime access, per-developer commercial license.

Curated withby Saivion

LibraryScreensResearch

Screen · AI

Research

A research answer that writes itself word by word, with sources and a follow-up bar.

A research answer screen: the question as a serif headline, source chips, and a long answer rendered by an incremental markdown parser with a per-word fade inside one stable Text, a blinking cursor, two-tone code blocks and a follow-up bar.

SwiftUIiOS 17.0+streaming-markdown

Get Swift Pieces Pro

$199 once, every piece included. See how installing works · Sign in

01

What's included

SwiftUI source you own, built on Apple frameworks only.

  • A research answer with the question, sources and follow-ups
  • An incremental block parser
  • A per-word fade without layout jumps
  • Two-tone code blocks and a blinking cursor

In the Build Kit

Editorial (style), AI Assistant (recipe). Your agent builds around this screen in the same design.

02

Implementation notes

How it behaves, what it handles, and the decisions behind it.

Feed it the growing string. A private block parser commits finished blocks at blank lines and closed fences and re-parses only the unfinished tail, so cost stays flat as the reply grows. Inline bold, italic, code and links go through Foundation's inline markdown parser. Each block is a single Text; while the tail is being written, young words are appended as separately styled slices of the same attributed string, so nothing reflows. A cursor blinks at the end while streaming, and code blocks use a two-tone palette with comments and strings in the secondary color.

Notes

  • Supported: #–###### headings, paragraphs, -/*/+ and numbered lists, fenced code with a language label, and inline bold, italic, code and links.
  • The text should only grow. If the new value does not start with the committed prefix (a regenerate, say) the parser resets.
  • Word arrival times are tracked per tail block; the fade runs in a TimelineView that pauses once the newest word is opaque and the stream has ended.
  • Unterminated inline markers render literally until closed, as they do in Foundation's parser.
  • Reduce Motion renders new words at full opacity and shows a static cursor.
  • The Research screen styles the renderer through StreamingMarkdownStyle alone: serif display headings from the theme, clay list markers, and code on the sand block with comments at 66% of its ink.
  • The sources sit in a horizontal rail of tilted color blocks (flat when Reduce Motion is on), and the follow-up bar's send button turns into Stop while the answer streams.
  • StreamingMarkdownExample at the end of StreamingMarkdown.swift is the Research screen from the preview.

03

Keep building

Pieces that work well next to this one.

Screen · AI

Chat

A complete AI chat with streaming replies, a composer that stops generation and follow-scroll.

Screen · AI

Ask

An assistant home with a briefing, suggested prompts and a composer that grows, attaches and records.

Screen · AI

Agent Task

An agent task screen with a live timeline of tool calls, durations and expandable results.