Post

Swift Underscored Variable

Swift Underscored Variable

Using conditionals inside template literals

Properties

1
2
3
self._momentDate is the Binding<Date> struct itself.
self.momentDate, equivalent to self._momentDate.wrappedValue, is a Date. You would use this when rendering the date in the view's body.
self.$momentDate, equivalent to self._momentDate.projectedValue, is also the Binding<Date>. You would pass this down to child views if they need to be able to change the date.
This post is licensed under CC BY 4.0 by the author.