My Xcode keeps giving me a Double is not convertible to CGFloat error. Thing is the error keeps moving whenever I change the code. At first it was on this line:
Text("left") .frame(width: 100.0, height: 100.0, alignment: .center)
where I set the height to 100.0 now it is at the bottom:TextField("example", text: "PLACEHOLDER") .frame(width: 300.0, height: 300.0, alignment: .center)
at the height.
On the apple dev site it says for swiftUI as an example:
.frame(width: 200, height: 200, alignment: .topLeading)
I tried removing the decimals and I get an Int is not convertible to CGFloat.
At one point I tried to put CGFloat() around each and I got a 'CGFloat is not convertible to CGFloat?' error
Any help is appreciated thank you
import Cocoa
import SwiftUI
HSplitView{
VStack{
Text("left")
.frame(width: 100.0, height: 100.0, alignment: .center)
Text("left bottom")
.frame(width: 100.0, height: 100.0, alignment: .center)
Text("leftbottombottom")
.frame(width: 100.0, height: 100.0, alignment: .center)
}
TextField("example", text: "PLACEHOLDER")
.frame(width: 300.0, height: 300.0, alignment: .center)
}