I have this variable:
@State var profileViewHeight: CGFloat = 200
and I need to update it based on a view as soon as it appears
This is what I've tried:
GeometryReader { geo in
userProfileView(uid: uid, userid: self.$userid, offsetMenu: self.$offsetMenu, closeThisView: closeThisView)
.frame(width: UIScreen.main.bounds.width)
.background(Color.teal)
.padding(.bottom, profileViewOffset)
.offset(y: profileViewOffset)
.zIndex(2)
profileViewHeight = geo.size.height
}
and I get the
Type '()' cannot conform to 'View'
error.
I also tried:
.onAppear(){
profileViewHeight = geo.size.height
}
but the ui gets bugged this way.
Please help