QUESTION IMAGE
Question
what is the entry point of a swiftui app?
o a. viewcontroller
b. appdelegate
c. @main struct myapp
d. scenedelegate
clear my choice
what is the main advantage of swiftui?
o a. more code
b. less readability
c. automatic ui updates
d. manual layout handling
clear my choice
what is the purpose of @binding in swiftui?
a. creating animations
b. sharing state with child views
c. managing app scenes
d. declaring constants
clear my choice
Brief Explanations
- For the first question: In SwiftUI, the entry point is defined using the
@mainattribute on a struct conforming to theAppprotocol (e.g.,@main struct MyApp).ViewControlleris more related to UIKit,AppDelegateandSceneDelegatewere used in older iOS app architectures before SwiftUI's simplified entry. - For the second question: SwiftUI's key advantage is its ability to automatically update the UI when the underlying data (state) changes. "More code" and "Less readability" are not advantages. "Manual layout handling" is something SwiftUI abstracts away compared to more manual UI - building approaches.
- For the third question:
@Bindingin SwiftUI is used to share mutable state between a parent view and its child views. It's not for creating animations (that might involve@Statewith animation modifiers in some cases), managing app scenes (handled at a higher - level app structure), or declaring constants (@Stateor regular constants are for that).
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
- c. @main struct MyApp
- c. Automatic UI updates
- b. Sharing state with child views