WWDC24 SALE: Save 50% on all my Swift books and bundles! >>

Possible typo on "Sharing an observed object with a new view" page

Forums > 100 Days of SwiftUI

Towards the bottom of the "Sharing an observed object with a new view" page, there's a code snippet:

    AddView(expenses: Expenses())

... which I couldn't get to compile. I'm guessing it's meant to have an open curly brace on the first line, thus:

#Preview {
    AddView(expenses: Expenses())

Is there a way I can suggest this as a small tweak to the page text? Is it a github repo, perhaps, that I can pull request to?


Is there a way I can suggest this as a small tweak to the page text?


Send an email to Paul Hudson. His email is listed on the bottom of the page you are looking at right now. ✉️

Hint: Do not distract him with conversation, observations, questions, or improvement requests. STAY ON TOPIC.

EMail Subject

The email subject should be DIRECT such as:

Subj: TYPO: Sharing an Observed Object article

Article Link

Copy the URL to the article link to your clipboard.

Email Message

Your message to Paul should be TO THE POINT.

------ SAMPLE MESSAGE -----------
Paul: I found a typo in this article.

The code snippet is >> explain the typo <<
I think it should be >> proposed correction <<

Love and Kisses,
Your fan Brendan
------- END of SAMPLE MESSAGE -----------

Follow Up

Next: More than likely he will NOT acknowledge your message directly. Instead, he'll correct the offending typo! Sleep well knowing you improved the world. THEN, you have an important follow up step. RETURN to this message thread and REMOVE YOUR MESSAGE. This is an important step.

Ask Siri to set a reminder for you, incase you are the forgetful type.


Hi @brendantwhite

This is what it says

Xcode also added some preview code so we can look at the design of the view while we were coding. If you find that down at the bottom of AddView.swift

Which would have been (with an probably an error on AddView() line)

#Preview {

and you have to add expenses: Expenses() to the AddView() to make it work.

So while you are correct that is a Typo if you did that change it should of complied unless you copied that code from the page.

PS Paul does not always look at the forum, so for typos (so easy to do) then email him (I wont tell you how to do that as I am sure that you are capable to do it yourself).


On occasion @twoStraws appreciates a little help from the forums:

See -> How to email @twoStraws


Update - this typo is now fixed. :-)



I think you made @twoStraw's newsletter this month! He posted an article about a member who wrote an email listing a number of typos in his articles. Well done!

For future reference "this month" = May 2024.


Save 50% in my WWDC sale.

SAVE 50% To celebrate WWDC24, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.