5-Day Swift Coding Challenge: Day 4

Apr 24 2025 · Swift 6.0, iOS 18, Swift Playground 4.6

Lesson 01: Day 4: Adding Interactivity

Demo: Modifying Views

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

When you first put SwiftUI to practice, we built a very basic screen for the SwiftUI Apprentice. Open that project in Swift Playgrounds. There are some critical issues. The image is too big. The title is too small. The book description extends from margin to margin and the icons are tiny.

Image("swiftui-apprentice")
    .frame(width: 250)
Image("swiftui-apprentice")
    .resizable()
    .frame(width: 250)
Image("swiftui-apprentice")
    .resizable()
    .frame(width: 250)
    .scaledToFit()
Image("swiftui-apprentice")
    .resizable()
    .scaledToFit()
    .frame(width: 250)
Image("swiftui-apprentice")
    .resizable()
    .scaledToFit()
    .frame(width: 250)
    .padding(.bottom)
.padding([.leading, .trailing], 20)
.padding(.bottom)
.font(.largeTitle)
.font(.system(size:32.0))
.font(.largeTitle)
.padding(20)
.font(.largeTitle)
.padding([.leading, .trailing], 16)
.padding(.horizontal, 16)
See forum comments
Cinema mode Download course materials from Github
Previous: Modifying Views Next: Adding Buttons