-
Notifications
You must be signed in to change notification settings - Fork 226
Adding Getting Started tutorial for SwiftUI / iOS 16. #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Getting Started tutorial for SwiftUI / iOS 16. #185
Conversation
.transition(.slide) | ||
.id(id) | ||
|
||
Press Cmd+R to run your app one last time, and you should see that pressing “Try Again” now smoothly animates the old activity off the screen, and replaces it with a new one. It even overlaps animations if you press “Try Again” repeatedly! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you explicitly tell the reader to build and run, but possibly also note that the animation works when you run in the simulator, but doesn't quite work as expected if you run it as a Preview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did consider that, because you're right that the SwiftUI preview is incorrect. However, it felt a bit like drawing attention to an Xcode bug, and I figured Apple would prefer we didn't do that. Any views, @TimTr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic! Mostly minor suggestions.
cc @TimTr to review + pull anyone else to make sure this is future proof etc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
The problem here is that we’ve told SwiftUI our user interface will have two views inside – the circle and some text – but we haven’t told it how to arrange them. Do we want them side by side? One above the other? Or in some other kind of layout? | ||
|
||
We get to choose, but I think here a vertical layout will look better. In SwiftUI we get that with a new view type called `VStack`, which is placed *around* our current code, like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should maybe not write the guide in first person, but rather passive (I think it's called?), i.e. not write "I think..."
Some fixes needed in post. |
* Update landing page content (#127) * First pass at the new Getting Started page (#174) * Adding Getting Started tutorial for SwiftUI / iOS 16. (#185) * Add data file with items for "Go Further" section (#184) * Add cli and library getting started guides (#192) * Getting started tweaks (#208) * Rename Markdown files to have an `.md` extension. (#209) * Fix typo (#214) * Update getting started page layout (#204) * Add documentation information to Getting Started (#226) * Add Vapor Getting Started guide (#229) * Update content-improvments branch per feedback (#244) * Tweak SwiftUI tutorial (#240) * Add TSPL Go Further section and resource thumbnails (#227) * Improve 'Why Swift?' section on landing page (#252) * Replace Go Further item for advanced String Under The Hood blog post with item for Structures and Classes chapter in TSPL (#254) * Update landing page layout (#267) * Link to developer.apple.com from apple use case (#291) * Smaller landing page changes on content improvements branch (#294) * Update Go Further section (#300) * Update icons and placeholder image (#301) * Improve description of use cases and getting started guides (#304) * POC: Feature random code snippet on landing page (#303) * New “Swift is…” and About page copy (#336) * Move link to A Swift Tour to the Use Cases section (#329) * Add consistent download section to start and end of each guide (#351) * Add a new install page, update the download page, and move release yml files into one file. (#310) * Update navigation for install page (#355) * Update cli and library getting started guides (#357) * Content improvement guide updates (#373) * Add value and reference types article (#377) * Add some showcase snippets (#371) * Resolve issue with Red Hat download links (#379) * Add Info about Scoop for Windows install page (#382) --------- Co-authored-by: Alexander Sandberg <[email protected]> Co-authored-by: Paul Hudson <[email protected]> Co-authored-by: James Dempsey <[email protected]> Co-authored-by: tomer doron <[email protected]> Co-authored-by: Dave Verwer <[email protected]> Co-authored-by: Tim Condon <[email protected]> Co-authored-by: Max Desiatov <[email protected]> Co-authored-by: Mishal Shah <[email protected]> Co-authored-by: AG <[email protected]> Co-authored-by: Ted Kremenek <[email protected]>
This adds the first draft of a Swift tutorial that builds a simple app using SwiftUI.
Motivation:
This is part of a wider movement to add meaningful Getting Started tutorials to the Swift.org website.
Modifications:
The directory and file are both new. The tutorial is enclosed inside a single file, which I think probably works best.
Result:
The new tutorial will sit alongside Vapor and CLI tutorials. Once we have a final draft, I think this would benefit from having a video and screenshots provided to bring it to life.