~/talk

Swift Scripts: Zero to Hero

Talkat UIKonf 2020 · 2020-05-17..05-20· [swift]
slides:none on file

Shows how to build a real Swift command‑line tool using Swift Package Manager executables, explains the role of main.swift, argument parsing with ArgumentParser, and handling inputs via CommandLine.arguments, FileHandle pipelines and Process.environment. Demonstrates interactive readline use, exit codes, and a progress UI from swift‑tools‑support‑core for terminal feedback. Covers packaging: build with swift build -c release, copy the resulting binary from .build/release into /usr/local/bin, and confirms the executable runs as expected.

AI-written summary · about

  1. 0:00Intro
  2. 1:40CREATING AN EXECUTABLE
  3. 2:16THE PACKAGE STRUCTURE
  4. 3:15PACKAGE.SWIFT
  5. 4:47BUILD RUN TEST
  6. 6:02LAUNCH ARGUMENTS
  7. 8:34INTERACTIVE
  8. 9:38ENVIRONMENT VARIABLES
  9. 11:06PIPELINE MESSAGES
  10. 14:24ARGUMENTPARSER
  11. 18:34SWIFTTOOLSSUPPORT'S
  12. 19:11ADDING A DEPENDENCY 2
  13. 19:38PROGRESS STATE
  14. 21:59USE THE SCRIPT ANYWHERE
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.