My Xcode projects and sources created during Hacking With Swift Live online-workshops hosted by @twostraws.
-
Various Swift 5.5 features and additions: Check out the code ContentView.swift
-
Message Inbox: Learning about the new basic concurrency features:
async
andawait
keywords, SwiftUI.task
modifier (as alternative to.onAppear
),async let
assignment andTask
struct to run/submit parallel tasks -
Practice Petitions: Writing a small app showing "petitions" fetched and decoded using the new concurrency approach
-
Practice Chat Messages: Writing an app downloading 3 independent JSON data files and displaying them using SwiftUI
-
Message Inbox: Learning more about the concurrency features: Task
suspend
, cancellation,sleep
,TaskGroup
. Read the code in ContentView.swift -
Practice News Stories: Writing a small app showing news stories fetched from 5 JSON feeds, concatenating and sorting for display.
-
Heterogenous TaskGroups: How to handle tasks within a
TaskGroup
returing different types? Wrap the result in anenum
! Read the code in ContentView.swift -
Practice TaskGroup: Writing a asynchonous
loadData
method fetching data from different locations and of different types, combining the result before updating the views model. Read the code in ContentView.swift! -
Actor: What is an actor and its purpose? Simple examples in ContentView.swift:
URLCache
,BankAccount
,BasketballTeam
andPlayer
. HandlingHashable
andCodable
for actors, when to usenonisolated
andisolated
keyword and how global actors, theMainActor
fit into the picture.Bonus: Using
Task.detached
to run code parallely not bound to the same actor which the View might inherit from its properties! -
Bus+: new features in SwiftUI so far
AsyncImage
,.task
modifier (to be continued on day 3!)
-
AsyncSequence: This session was an introduction to
AsyncSequence
hosted by Daniel H Steinberg. First reminder aboutSequence
andIterator
protocol and conformance, then introducing asynchronicity by using notifications (and the newNotification
sequence which conforms toAsyncSequence
), implementing own data model usingAsyncSequence
andAsyncIterator
, finally usingAsyncStream
. -
Bus+: illustrating more new features of SwiftUI
refreshable
to reload busses list with a "pull to refresh" gesturesearchable
to allow searching/filtering the list of busses- Adding
swipeActions
for "Add favorite" button - tinting list row separators and using a few new colors
indigo
,mint
andcyan
- using
foregroundStyle
to add a gradient drawing to a SF symbol - using
symbolRenderingMode
to draw SF symbols hierarchically - using Markdown styling for
Text
rendering - using
ultraThinMaterial
to have a blured background when a bus has been selected - using
focused
modifier,submitLabel
andonSubmit
to implement a User input form with automatic input focussing. - adding "Next" and "Done" buttons to keyboard toolbar (using
ToolbarItemGroup(placement: .keyboard)
) - illustrating
ObservableObject
using@MainActor
to validate some user data - adding a
badge
modifier to atabItem
to highlight missing user input - Bonus: generating a QR code from user provided data (using CoreImage
CIFilter
) - Bonus: using
Mirror
to introspectBus
type for improved search completion