Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find CGSize or CGFloat type #450

Closed
softknife opened this issue Sep 30, 2021 · 3 comments
Closed

Can't find CGSize or CGFloat type #450

softknife opened this issue Sep 30, 2021 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@softknife
Copy link

Describe the bug
I found CGXX type error when i try to build a swift web app

Screenshots
this is my code

struct CalculatorButton: View {
    
    var fontSize : CGFloat = 38
    let title : String
    var size:CGSize
    let backgroundColor:Color
    let action:()->Void
    var body: some View {
        Button(action: action) {
            Text(title)
                .font(.system(size: fontSize))
                .foregroundColor(.white)
                .frame(width: size.width, height: size.height, alignment: .center)
                .background(backgroundColor)
                .cornerRadius(size.width * 0.5)
        }
    }
}

This is error info :
Error info

***Desktop ***

  • OS: [11.5.2 macOS]
  • Browser :chrome
  • Version of the browser : 94.0.4606.61
  • Version of Tokamak 0.8.0
@softknife softknife added the bug Something isn't working label Sep 30, 2021
@MaxDesiatov
Copy link
Collaborator

@softknife thanks for the report! Would you be able tor provide the full error message here? Seems like the most important part of it is cut off on the screenshot

@MaxDesiatov MaxDesiatov added question Further information is requested and removed bug Something isn't working labels Sep 30, 2021
@MaxDesiatov MaxDesiatov assigned softknife and unassigned MaxDesiatov Sep 30, 2021
@MaxDesiatov
Copy link
Collaborator

If the error you're getting is about unavailable CGFloat, you'll have to add import Foundation in your source file to get access to this type, since it's defined in Foundation, not Tokamak.

@softknife
Copy link
Author

ok , done , thank you @MaxDesiatov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants