0
0
iOS Swiftmobile~10 mins

Xcode installation and setup in iOS Swift - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the main framework needed for iOS app development in Swift.

iOS Swift
import [1]
Drag options to blanks, or click blank then click option'
AUIKit
BFoundation
CSwiftUI
DCoreData
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing Foundation which is for basic data types and utilities, not UI.
Choosing SwiftUI which is a newer UI framework but not the main one for all projects.
2fill in blank
medium

Complete the code to create a basic SwiftUI app entry point after installing Xcode.

iOS Swift
@main
struct MyApp: [1] {
  var body: some Scene {
    WindowGroup {
      ContentView()
    }
  }
}
Drag options to blanks, or click blank then click option'
AApp
BAppDelegate
CUIViewController
DSceneDelegate
Attempts:
3 left
💡 Hint
Common Mistakes
Using AppDelegate which is for UIKit lifecycle, not SwiftUI.
Using UIViewController which is a UI component, not the app entry.
3fill in blank
hard

Fix the error in the code to correctly create a new SwiftUI Text view in Xcode.

iOS Swift
var body: some View {
  [1]("Hello, world!")
}
Drag options to blanks, or click blank then click option'
ALabel
BButton
CText
DView
Attempts:
3 left
💡 Hint
Common Mistakes
Using Label which requires an image and text.
Using Button which is interactive, not for static text.
4fill in blank
hard

Fill both blanks to declare a variable and assign it a string value in Swift after setting up Xcode.

iOS Swift
var [1]: String = [2]
Drag options to blanks, or click blank then click option'
Agreeting
B"Hello"
Cmessage
D"World"
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the string value.
Using a number or wrong variable name.
5fill in blank
hard

Fill all three blanks to create a SwiftUI VStack with two Text views inside after installing Xcode.

iOS Swift
VStack {
  [1]("Welcome")
  [2]("to SwiftUI")
  [3]("App")
}
Drag options to blanks, or click blank then click option'
AText
BButton
CLabel
DImage
Attempts:
3 left
💡 Hint
Common Mistakes
Using Button or Label which changes the UI interaction.
Using Image which requires an asset.