kodecocodes / swiftui-example-app-koober

Porting the example app from our Advanced iOS App Architecture book from UIKit to SwiftUI.
59 stars 11 forks source link

Uses view types to capture fixed scope values such as user session. #11

Closed RCacheaux closed 5 years ago

RCacheaux commented 5 years ago

Checklist

Description

Views that exist within scopes that come and go (such as authenticated user scope) can capture their fixed scope as property values rather than reaching through the app's state. Reaching through the app's state requires dealing with optionals and leads to force unwrapping values. This PR adds constant value properties on views to capture scoped state values.