Загрузка...

SwiftUI Find The Error Challenge! (easy) #swiftui

Here are the answers below!
Level 1:
1) @State var showSettings: Bool = false
2) @State var showSettings: false = Bool
(Number 1 is correct, the second one has the type and value switched)

Level 2:
(looking at the padding)
1) .padding([.left, .bottom], 10)
2) .padding({.leading, .bottom], 10)
(Number 2 is correct. We don’t say “.right” or “.left”, we say .leading and .trailing)

Level 3:
1) HomeScreen(environmentObject: vm)
2) HomeScreen().environmentObject(vm)
(Number 2 is correct. This is in reference to passing in a @StateObject using .environmentObject, and the first syntax is for passing in expected parameters.)

How many did you get?

(Working on MacOS? Check our my apps RestEyes and Focus Bear to be productive without eye strain! Happy Coding :)

#swiftUI #appDevelopment #coding #learningToCode #iosAppDevelopment

Видео SwiftUI Find The Error Challenge! (easy) #swiftui канала App Chat
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять