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

LibraryScreensAsk

Screen · AI

Ask

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

An assistant home screen: a briefing card with highlighted figures, suggested prompts as chips and a composer with a spring-growing field, sliding attachment chips, a hold-to-record pill with live waveform and timer, and a send button that pops in and morphs to stop while generating; glass on iOS 26.

SwiftUIiOS 17.0+prompt-composer

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.

  • An assistant home with a briefing and suggested prompts
  • A spring-growing field and sliding attachment chips
  • Hold to record, with a live waveform and timer
  • Send morphs to stop while generating

In the Build Kit

AI Assistant (brief), 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.

The home of an assistant: a two-tone greeting, a briefing block with the day's figures, suggested prompts as chips and PromptComposer riding the bottom edge. The composer's field grows with a spring up to maxLines, attachment chips slide in above it, and the trailing button follows the state: a mic when there is nothing to send, a send button that pops in when there is, and a stop button that morphs from it while generating. Hold the mic and a recording pill with a live waveform and a timer grows out of it; release to finish. Tap the mic to latch recording instead. Glass on iOS 26 with a Material fallback, or a solid surface when you pass one.

Notes

  • States: empty, typing, attaching (chips, no text), recording, generating. Send is enabled in typing and attaching; the field stays editable while generating.
  • The mic is one DragGesture(minimumDistance: 0): a release before 280 ms toggles the latch, a hold past it records until the finger lifts. The mic stays under the finger throughout so the gesture is never cancelled.
  • recordingLevel drives the pill's waveform; without it the bars idle at a low amplitude. The timer rolls with numericText.
  • Put it in .safeAreaInset(edge: .bottom) so it rides the keyboard; tapping the surface focuses the field.
  • Haptics: rigid impact when recording starts or stops, soft impact on send, selection when a chip is added or removed. Reduce Motion shortens every spring; Reduce Transparency uses an opaque surface.
  • On the screen, a suggestion fills the field instead of sending, so the question can be edited first. The answer streams into a card stacked above the composer in the same inset, so it never hides behind the keyboard; Stop keeps the partial answer with a Retry.
  • The briefing is a solid lime block with glow rings cropped at its corner; the rail of suggestions scrolls both rows together and crops at the trailing edge.
  • PromptComposerExample at the end of PromptComposer.swift is the Ask 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

Research

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

Screen · AI

Agent Task

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