this is my array
var StudentMenuData = ["house": "Home","person.crop.circle": "Profile","bell": "Notifications","message": "Messages","doc.text": "Syllabus","power": "LogOut"]
and here's i am trying to use it
for (key,value) in StudentMenuData {
Text("")
}
but its showing this error:
Closure containing control flow statement cannot be used with result builder 'ViewBuilder'
but same code is working in playground.
The error means what is says: Syntax like
if let
or fast enumeration cannot be used within the rendering area of a SwiftUI view.A possible way is
Side note: Please name variables with starting lowercase letter