Contents

levelOfDetail

The level of detail the view is recommended to have.

Declaration

var levelOfDetail: LevelOfDetail { get set }

Discussion

Read from the environment with

@Environment(\.levelOfDetail) var levelOfDetail

To customize your view based on recommended level of detail, read the environment value using the .levelOfDetail key and apply that to change your view.

var body: some View {
     switch levelOfDetail {
     case .default:
         VStack {
            NewsTitleView()
            NewsBodyView()
         }
     case .simplified:
         NewsImageOverview()
     }
}