0%

Learn SwiftUI by designing and building complex user interfaces for watchOS, iPadOS, and iOS with the help of projects including a financial app, a sports news app, and a POS system

Key Features

  • Learn SwiftUI with the help of practical cross-platform development projects
  • Understand the design considerations for building apps for different devices such as Apple Watch, iPhone, and iPad using SwiftUI's latest features
  • Work with advanced SwiftUI layout features, including SF Symbols, SwiftUI grids, and forms in SwiftUI

Book Description

Released by Apple during WWDC 2019, SwiftUI provides an innovative and exceptionally simple way to build user interfaces for all Apple platforms with the power of Swift.

This practical guide involves six real-world projects built from scratch, with two projects each for iPhone, iPad, and watchOS, built using Swift programming and Xcode. Starting with the basics of SwiftUI, you'll gradually delve into building these projects. You'll learn the fundamental concepts of SwiftUI by working with views, layouts, and dynamic types. This SwiftUI book will also help you get hands-on with declarative programming for building apps that can run on multiple platforms. Throughout the book, you'll work on a chart app (watchOS), NBA draft app (watchOS), financial app (iPhone), Tesla form app (iPhone), sports news app (iPad), and shoe point-of-sale system (iPad), which will enable you to understand the core elements of a SwiftUI project.

By the end of the book, you'll have built fully functional projects for multiple platforms and gained the knowledge required to become a professional SwiftUI developer.

What you will learn

  • Understand the basics of SwiftUI by building an app with watchOS
  • Work with UI elements such as text, lists, and buttons
  • Create a video player in UIKit and import it into SwiftUI
  • Discover how to leverage an API and parse JSON in your app using Combine
  • Structure your app to use Combine and state-driven features
  • Create flexible layouts on iPad

Who this book is for

SwiftUI Projects is intended for anyone who is already comfortable with Swift. We do not cover Swift topics in detail, so you need to be familiar with these already. All of the SwiftUI topics are taught as if this is the first time you've learned them and will gradually get more difficult.

Table of Contents

  1. SwiftUI Projects
  2. Why subscribe?
  3. Contributors
  4. About the author
  5. About the reviewer
  6. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Reviews
  8. Chapter 1: SwiftUI Basics
    1. Technical requirements
    2. Views and controls
    3. Text
    4. TextField
    5. SecureField
    6. Image
    7. Modifying an image
    8. Buttons
    9. Shapes
    10. Circle
    11. Rectangle
    12. Ellipse
    13. Capsule
    14. Rounded Rectangle
    15. View layout and presentation
    16. VStack
    17. VStack with a spacer
    18. HStack
    19. HStack with spacer
    20. ZStack
    21. Group
    22. ForEach
    23. List
    24. ScrollView
    25. Summary
  9. Chapter 2: SwiftUI Watch Tour
    1. Technical requirements
    2. Getting started
    3. Building out our navigation
    4. Creating a static list
    5. Creating a chart Page-View navigation
    6. Creating a SwiftUI watch list
    7. Using Swift previews
    8. Charts
    9. Bar charts
    10. Activity Ring
    11. Creating our wedge
    12. Summary
  10. Chapter 3: NBA Draft – Watch App
    1. Technical requirements
    2. Building our watch UI
    3. Walking through the design specs
    4. Accessibility and fonts
    5. System fonts
    6. Custom fonts
    7. Designing the menu
    8. Designing draft cards
    9. Adding our properties
    10. Adding our header
    11. Adding our card contents
    12. Adding the top of the card
    13. Adding the bottom of the card
    14. Designing the prospect details
    15. Creating a details prospect header
    16. Creating the details prospect header
    17. Creating detailed prospect stats
    18. Creating detailed prospect info
    19. Connecting our views
    20. Refactoring views
    21. Refactoring ContentView
    22. Refactoring the detail view
    23. Adding watch data
    24. Updating the menu with DraftRound
    25. Updating the draft list with pick data
    26. Updating the Draft List Card
    27. Adding data to DraftCardView
    28. Challenge – Updating the details view with prospect data
    29. Summary
  11. Chapter 4: Car Order Form – Design
    1. Technical requirements
    2. The overall design
    3. Understanding the structure
    4. Car Detail
    5. Creating Basic car info view
    6. Creating our Car Info Detail view
    7. Creating our Car Info Photos section
    8. Displaying our Car Info view
    9. Wrapping up Car Detail
    10. The form view
    11. Complete Order design
    12. The Top Order view
    13. Bottom Order view
    14. The Complete Order view
    15. Combining our views
    16. Cancel Order design challenge
    17. Summary
  12. Chapter 5: Car Order Form – Data
    1. Technical requirements
    2. Understanding State and Binding
    3. Difference between @Binding and @State
    4. Combine 101 – discussing the basics
    5. Three main ingredients
    6. Networking with Combine
    7. Understanding observable objects
  13. Chapter 6: Financial App – Design
    1. Technical requirements
    2. Understanding our App design
    3. Understanding the home view logic
    4. Home header
    5. Creating our card view
    6. Home submenu view (challenge 1)
    7. Creating an account summary
    8. Creating our home view
    9. Creating an account
    10. Color button menu
    11. Credit card type menu
    12. Form view
    13. Bringing it all together – CreateAccountView
    14. Create account list (challenge 3)
    15. Summary
  14. Chapter 7: Financial App – Core Data
    1. Technical requirements
    2. What is Core Data?
    3. What is a managed object model?
    4. What is an object context?
    5. What is a persistent store coordinator?
    6. Creating a data model
    7. Creating Core Data entities
    8. Adding model properties
    9. Understanding Core Data relationships
    10. Core Data Codegen
    11. Core Data manager
    12. SwiftUI and Core Data optionals
    13. Mock account preview service
    14. Implementing our View model
    15. Core Data challenge
    16. Updating ContentView with an environment object
    17. Summary
  15. Chapter 8: Shoe Point of Sale System – Design
    1. Displaying the app container
    2. Creating a products header view
    3. Creating our main products container
    4. Creating the shopping cart header
    5. Creating a cart total display
    6. Displaying our cart view
    7. Viewing our custom split view
    8. Creating the products
    9. ProductsContentView
    10. Product details
    11. Creating custom buttons for our product details view
    12. SizeCartItemView
    13. Creating the shopping cart
    14. Designing the cart item view
    15. Cart content view
    16. Summary
  16. Chapter 9: Shoe Point of Sale System – CloudKit
    1. Understanding the basics of CloudKit
    2. Turning on CloudKit manually
    3. Creating our first CloudKit record
    4. How to index a new record type in CloudKit Dashboard
    5. Creating CloudKit models
    6. CloudKit extensions
    7. Creating our product model
    8. Creating brands
    9. CloudKit helper
    10. Creating our view model
    11. Creating our dummy data
    12. Displaying CloudKit models
    13. Displaying data in the product details view
    14. The shopping cart
    15. Updating our product views
    16. Summary
  17. Chapter 10: Sports News App – Design
    1. Creating a sidebar
    2. Prototyping our app with boxes
    3. HeaderView
    4. Quick challenge
    5. Dashboard
    6. Roster prototyping
    7. Schedule prototyping
    8. Prototyping the game details
    9. Designing dashboard module views
    10. Video player with a grid
    11. The featured news module
    12. The featured player module
    13. The standings module view
    14. Playoff module design challenge
    15. Roster
    16. RosterHeaderView
    17. RosterView
    18. Schedule
    19. Game detail challenge
    20. Summary
  18. Chapter 11: Sports News App – Data
    1. Mockoon
    2. API design
    3. Creating the API class
    4. Dashboard data
    5. Latest video
    6. Model challenge time
    7. Updating more dashboard data
    8. Creating our View model
    9. Implementing our View model
    10. Connecting feeds to FeaturedArticleModuleView
    11. Updating FeaturedPlayerModuleView
    12. Updating PlayerCardView
    13. Updating RosterView
    14. Standings
    15. StandingItem
    16. Final challenge
    17. Summary
  19. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
3.89.163.156