a declarative framework to compose the layout and behavior of multiplatform apps
Declarative syntax 선언형 문법
기존의 명령형과 무엇이 다른거지🤔
"명령형은 코끼리를 냉장고에 넣기 위해서 냉장고 문을 열고 코끼리를 들고 냉장고에 넣고 냉장고 문을 닫는다. 선언형은 코끼리에 냉장고를 넣을거야."
명령형에 비해 편리하지만 내부적으로 개발자가 컨트롤하지 못하는 부분은 더 많아지는 건가?
Compositional API
Powerful layout system
Views reflect app data
Automatic accessibility support
SwiftUI automatically includes the animations when pushing and popping from the navigation stack.
You’ll store changes to the scrum in a Data property. You’ll define the property using the @State wrapper because you need to mutate the property from within the view.
SwiftUI observes
@State
properties and automatically redraws the view’sbody
when the property changes. This behavior ensures the UI stays up to date as the user manipulates the onscreen controls.
tutorial | https://developer.apple.com/tutorials/app-dev-training
https://developer.apple.com/tutorials/app-dev-training/getting-started-with-scrumdinger