Section I: Your first app: HIITFit

In this section, you’ll begin your journey to becoming a SwiftUI developer by developing an app called HIITFit, a High Intensity Interval Training Fitness tracker. Along the way, you’ll:

  1. • Learn how to use Xcode.
  2. • Discover how to plan and prototype an app.
  3. • Explore the basic components of SwiftUI.
  4. • Understand how data moves in a SwiftUI app and how to make it persist.
  5. • Learn fundamental concepts of Swift, the programming language, needed to build your app

image.png

👀 Chapter 1: Checking Your Tools

A quick tour of Xcode

And all three have keyboard shortcuts:
• Hide/show Navigator: Command-0
• Hide/show Inspectors: Option-Command-0
• Hide/show Debug Area: Shift-Command-Y

What else is in your project?

In an iOS app, the view hierarchy fills the entire display. In a macOS or iPadOS app, WindowGroup can manage multiple windows.

  • Products: This is where Xcode stores your app after you build and run the project. A project can contain other products, like a Watch app or a framework

    Xcode Preferences

    1. struct ContentView_Previews: PreviewProvider {
    2. static var previews: some View {
    3. Group {
    4. ContentView()
    5. ContentView()
    6. .previewDevice("iPhone SE (2nd generation)")
    7. }
    8. }
    9. }

    👀 Chapter 2: Planning a Paged App

image.png

👀 Chapter 3: Prototyping the Main View

image.png

Playing a video: AVKit

Getting the URL of a bundle file

  1. if let url = Bundle.main.url(
  2. forResource: videoNames[index],
  3. withExtension: "mp4") {}

Getting the screen dimensions

  1. .frame(height: geometry.size.height * 0.45)

image.png

Creating the Timer view

  1. Text(Date().addingTimeInterval(interval), style: .timer)
  2. .font(.system(size: 90))

image.png

Chapter 4: Prototyping Supplementary View